예제 #1
0
 public function detailsTimerAction($id)
 {
     $timer = Timers::find($id);
     $content = Input::get('notes');
     if (!empty($content)) {
         $content = nl2br(htmlentities($content));
         $note = new Notes(array('content' => $content));
         $note->user()->associate(Auth::user());
         $timer->notes()->save($note);
         return Redirect::route('details', $timer->id)->with('flash_msg', 'Note added.');
     }
     return Redirect::route('details', $timer->id)->with('flash_error', 'Unable to add note. Try adding some content.');
 }
예제 #2
0
 public function actionsaveNotes()
 {
     $noteModel = Notes::model()->findByAttributes(array('form' => $_POST['model'], 'cus_id' => getCurCusId()));
     if (!$noteModel) {
         $noteModel = new Notes();
     }
     if (isset($_POST['notes']) && isset($_POST['model'])) {
         $noteModel->text = $_POST['notes'];
         $noteModel->form = $_POST['model'];
         $noteModel->cus_id = getCurCusId();
         $noteModel->save();
     }
 }
예제 #3
0
 public function store()
 {
     Notes::where('email', Auth::user()->email)->update(array('notes' => Input::get('notes')));
     TBD::where('email', Auth::user()->email)->update(array('tbd' => Input::get('tbd')));
     $input = Input::all();
     for ($i = 0; $i < count($input); $i++) {
         if (!Links::where('links', '=', Input::get("link{$i}"))->exists()) {
             if (Input::get("link{$i}") != "") {
                 Links::insert(array('email' => Auth::user()->email, 'links' => Input::get("link{$i}")));
             }
         }
     }
     if (Input::hasFile('photo')) {
         $count = Image::where('email', Auth::user()->email)->count();
         if ($count >= 4) {
             echo "USER CAN ONLY HAVE 4 PHOTOS MAX";
             return Redirect::back();
         }
         $extension = Input::file('photo')->getClientOriginalExtension();
         if ($extension == "gif" || $extension == "jpeg") {
             Image::insert(array('email' => Auth::user()->email, 'image' => file_get_contents(Input::file('photo'))));
         } else {
             echo "CAN ONLY DO GIF OR JPEG";
         }
     }
     $imageCount = Image::where('email', Auth::user()->email)->count();
     for ($i = 0; $i < $imageCount - 1; $i++) {
         if (Input::get("delete{$i}") != null) {
             $imageTable = Image::where('email', Auth::user()->email)->get();
             //echo $imageTable[$i+1]["id"];
             Image::where('id', $imageTable[$i]["id"])->delete();
         }
     }
     return Redirect::to('profile');
 }
예제 #4
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $users = Users::get();
     $comments = Comments::get();
     $supports = Supports::get();
     $notes = Notes::get();
     $usersJson = array();
     $commentsJson = array();
     $supportsJson = array();
     $notesJson = array();
     // build users
     foreach ($users as $user) {
         array_push($usersJson, array('id' => $user->id, 'name' => $user->name));
     }
     // build comments
     foreach ($comments as $comment) {
         array_push($commentsJson, array('id' => $comment->id, 'article_id' => $comment->article_id, 'user_id' => $comment->user_id, 'comment' => $comment->comment, 'challenge' => $comment->challenge));
     }
     // build supports
     foreach ($supports as $support) {
         array_push($supportsJson, array('id' => $support->id, 'user_id' => $support->user_id, 'comment_id' => $support->comment_id));
     }
     // build notes
     foreach ($notes as $note) {
         array_push($notesJson, array('id' => $note->id, 'comment_id' => $note->comment_id, 'comment' => $note->comment));
     }
     // build json
     $json = array('users' => $usersJson, 'comments' => $commentsJson, 'supports' => $supportsJson, 'notes' => $notesJson);
     // display json
     echo json_encode($json);
 }
예제 #5
0
 public function actionNotes()
 {
     Yii::app()->clientScript->registerCssFile(Yii::app()->theme->baseUrl . "/css/request-notes.css");
     Yii::app()->clientScript->registerCssFile(Yii::app()->theme->baseUrl . "/css/request-notes-resp.css");
     Yii::app()->clientScript->registerScriptFile(Yii::app()->theme->baseUrl . "/js/request-notes.js", CClientScript::POS_END);
     $criteria = new CDbCriteria();
     $criteria->addCondition('mstNoteUsers.user_id = ' . Yii::app()->user->getInfo());
     $criteria->addCondition('t.request_id = ' . $this->_model->id);
     $criteria->with = array('mstNoteUsers', 'request');
     $criteria->group = 'note_id';
     $modelArray = Notes::model()->findAll($criteria);
     $noteIdsArray = array();
     foreach ($modelArray as $model) {
         $noteIdsArray[] = $model->id;
     }
     $stringIds = implode("', '", $noteIdsArray);
     $criteria = new CDbCriteria();
     $criteria->addCondition("note_id IN ('" . $stringIds . "')");
     //        $criteria->addCondition("user_id != 1");
     $notesUsersArray = MstNoteUser::model()->findAll($criteria);
     $usersArray = array();
     foreach ($notesUsersArray as $notesUser) {
         $usersArray[$notesUser->note_id][] = array('id' => $notesUser->user_id, 'fullName' => $notesUser->user->firstName . ' ' . $notesUser->user->lastName);
     }
     $this->render('notes', array('model' => $this->_model, 'notesArray' => $modelArray, 'usersArray' => $usersArray));
 }
 public function store()
 {
     if (!Input::has('email', 'password', 'confirmPassword')) {
         $this->failure("Must fill in the values");
     }
     if (Input::get('password') != Input::get('confirmPassword')) {
         $this->failure("PASSWORDS NOT THE SAME");
     }
     $rules = array('email' => 'unique:users,email');
     $validator = Validator::make(Input::all(), $rules);
     if ($validator->fails()) {
         $this->failure('That email address is already registered. You sure you don\'t have an account?');
     }
     if (!filter_var(Input::get('email'), FILTER_VALIDATE_EMAIL)) {
         $this->failure("username must be an email");
     }
     $verificationCode = md5(time());
     User::insert(array('email' => Input::get('email'), 'password' => Hash::make(Input::get('password')), 'verification' => $verificationCode));
     Image::insert(array('email' => Input::get('email'), 'image' => ''));
     Notes::insert(array('email' => Input::get('email'), 'notes' => ''));
     TBD::insert(array('email' => Input::get('email'), 'tbd' => ''));
     Links::insert(array('email' => Input::get('email'), 'links' => ''));
     Mail::send('emails.emailMessage', array('code' => $verificationCode, 'email' => Input::get('email')), function ($message) {
         $message->to('*****@*****.**', 'Jan Ycasas')->subject('Welcome!');
     });
     echo "Go Log In";
     return Redirect::to('/');
 }
예제 #7
0
 public static function updateNote($noteID, $noteData)
 {
     global $db;
     // check if exists
     if (Notes::getNote($noteID)) {
         return $db->update('notes', $noteData, ['id' => $noteID]);
     }
     return -1;
 }
예제 #8
0
 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store()
 {
     $data = Input::except(array('_token'));
     $rule = array('comment_id' => 'required|exists:comments,id', 'comment' => 'required');
     $validator = Validator::make($data, $rule);
     if ($validator->fails()) {
         /*return Redirect::to('comments')
           ->withErrors($validator->messages());*/
         return 'false';
     } else {
         Update::saveFormData(array("time" => time()));
         Notes::saveFormData(Input::except(array('_token')));
         /*return Redirect::to('comments')
           ->withMessage('success');*/
         return 'true';
     }
 }
 public function getNoteById($id)
 {
     // TODO: Implement getNoteById() method.
     $noteStmh = $this->db->prepare("SELECT * from Notes WHERE Id = :id");
     $nid = intval($id);
     $noteStmh->bindParam(':id', $nid);
     $noteStmh->execute();
     $noteStmh->setFetchMode(\PDO::FETCH_ASSOC);
     if ($row = $noteStmh->fetch()) {
         $myNotes = new Notes();
         $myNotes->setSubject($row['Subject']);
         $myNotes->setNotes($row['Notes']);
         $myNotes->setAuthor($row['Author']);
         $myNotes->setId($row['Id']);
         $myNotes->setDatecr($row['Datecr']);
         return $myNotes;
     } else {
         return new Notes();
     }
     //        $noteList = $this->getAllNotes();
     //        if (array_key_exists($id, $noteList)) {
     //            return $noteList[$id];
     //        }
 }
예제 #10
0
파일: Aps.php 프로젝트: ranvijayj/htmlasa
    /**
     * Get last AP notes
     * @param $apList
     * @return array
     */
    public static function getAPNotes($doc_id)
    {
        $notes = array();

            $note = new Notes();
            $condition = new CDbCriteria();
            $condition->condition = "Client_ID='" . Yii::app()->user->clientID . "'";
            $condition->addCondition("Document_ID = '" . $doc_id . "'");
            $condition->addCondition("Company_ID='0'");
            $condition->order = "Created DESC";
            $ap_note = $note->findAll($condition);



        return $ap_note;
    }
예제 #11
0
파일: index.php 프로젝트: prottoy/Notes
        } else {
            $this->retrieveAllNotes();
        }
    }
    function deleteNote($_id)
    {
        //This will delete the note with id
        $sql = "DELETE FROM notes WHERE id = '{$_id}'";
        if ($this->conn->query($sql)) {
            $data = array('Status' => 'Success', 'message' => 'deleted Successfully', 'debug' => $sql);
            echo json_encode($data);
        } else {
            $data = array('Status' => 'Failure', 'message' => 'delete failure', 'debug' => $sql);
            echo json_encode($data);
        }
    }
    function updateNote($_id, $_title, $_description)
    {
        //This will delete the note with id
        $sql = "UPDATE notes SET title='{$_title}',note='{$_description}' WHERE id='{$_id}';";
        if ($this->conn->query($sql)) {
            $this->retrieveAllNotes();
        } else {
            $this->retrieveAllNotes();
        }
    }
}
// MARK :- NOTE METHODS
$notes = new Notes($servername, $username, $password, $dbname);
$notes->enableDebug();
$notes->service();
예제 #12
0
    }
    exit;
} elseif (POST('action') == 'new_ajax') {
    $txt = POST('txt');
    ossim_valid($txt, OSS_TEXT, OSS_PUNC_EXT, 'illegal:' . _('Note text'));
    if (ossim_error()) {
        die(ossim_error());
    }
    if (Notes::insert($conn, $type, gmdate('Y-m-d H:i:s'), Session::get_session_user(), $id, $txt)) {
        echo json_encode(array('state' => 'OK'));
    } else {
        echo json_encode(array('state' => 'ERR'));
    }
    exit;
}
$notes = Notes::get_list($conn, " AND type='{$type}' AND asset_id = UNHEX('{$id}') ORDER BY date DESC");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
	<title> <?php 
echo _("OSSIM Framework");
?>
 </title>
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
	<meta http-equiv="Pragma" CONTENT="no-cache"/>
	
	<link rel="stylesheet" type="text/css" href="/ossim/style/av_common.css?t=<?php 
echo Util::get_css_id();
?>
"/>
예제 #13
0
<?php

require_once '..\\class\\Notes.php';
$o = new Notes();
$r = $o->create_new_note($_POST['note']);
echo json_encode($r);
return;
예제 #14
0
<?php

require_once '..\\class\\Notes.php';
$o = new Notes();
$r = $o->update_note($_POST['id'], $_POST['isChecked']);
echo json_encode($r);
return;
예제 #15
0
function delete_note($conn)
{
    $validate = array('note_id' => array('validation' => 'OSS_DIGIT', 'e_message' => 'illegal:' . _('Note ID')));
    $validation_errors = validate_form_fields('POST', $validate);
    if (is_array($validation_errors) && !empty($validation_errors)) {
        Av_exception::throw_error(Av_exception::USER_ERROR, _('Error! Note could not be deleted'));
    }
    $note_id = POST('note_id');
    $result = Notes::delete($conn, $note_id);
    if ($result == TRUE) {
        $data['msg'] = _('Note deleted successfully');
    } else {
        Av_exception::throw_error(Av_exception::USER_ERROR, _('Error! Note could not be deleted'));
    }
    return $data;
}
예제 #16
0
파일: editor.php 프로젝트: Gimcrack/aimsys
$editor_html = $oEditor->_html();
// Controls HTML
$edit_display = $rowid != 'new' && empty($editing) ? '' : 'display:none';
$new_display = $rowid != 'new' && empty($editing) ? 'display:none' : '';
$controls_html = <<<HTML
<a href="#" id="lb-edit" style="{$edit_display}" class="easyui-linkbutton" iconcls="icon-edit" tt="Edit Record">Edit</a>
<a href="#" id="lb-refresh" style="{$edit_display}" class="easyui-linkbutton" iconcls="icon-reload" tt="Refresh Record">Refresh</a>
<a href="#" id="lb-save" style="{$new_display}" class="easyui-linkbutton" iconcls="icon-save" tt="Save Changes">Save</a>
<a href="#" id="lb-reset" style="{$new_display}" class="easyui-linkbutton" iconcls="icon-reload" tt="Reset Changes">Reset</a>
<div class="toolbar-separator"></div>
<a href="#" id="lb-close" style="{$edit_display}" class="easyui-linkbutton" iconcls="icon-cancel" tt="Close Record">Close</a>
<a href="#" id="lb-cancel" style="{$new_display}" class="easyui-linkbutton" iconcls="icon-cancel" tt="Cancel Changes">Cancel</a>
<div class="toolbar-separator"></div> 
HTML;
// Get notes
$oNotes = new Notes($table, $rowid);
$oNotes->_getNotes();
$oNoteTable = new table("aimnotes", $oNotes->notes);
$notes_html = $oNoteTable->_quickview();
$notes_controls_html = <<<HTML
<a href="#" id="lb-new-note" class="easyui-linkbutton" iconcls="icon-edit" tt="New Note" onclick="new_note('{$table}','{$rowid}')">New</a>
<div class="toolbar-separator"></div>
<a href="#" id="lb-refresh-note" class="easyui-linkbutton" iconcls="icon-reload" tt="Refresh Notes">Refresh</a>
HTML;
// Get View
$oView = new view($view);
// Display View Script and View HTML
echo document::_addScript($oView->_script());
echo document::_addScript("ready.js");
include_once $oView->_html();
echo '<div class="clear"></div>';
예제 #17
0
 * All Rights Reserved.
 * Contributor(s): ______________________________________..
 ********************************************************************************/
/*********************************************************************************
 * $Header: /advent/projects/wesat/ec_crm/sugarcrm/modules/Notes/EditView.php,v 1.13 2005/04/18 10:37:49 samk Exp $
 * Description: TODO:  To be written.
 * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
 * All Rights Reserved.
 * Contributor(s): ______________________________________..
 ********************************************************************************/
require_once 'include/CRMSmarty.php';
require_once 'data/Tracker.php';
require_once 'modules/Notes/Notes.php';
require_once 'include/utils/utils.php';
global $app_strings, $app_list_strings, $mod_strings, $theme, $currentModule;
$focus = new Notes();
$smarty = new CRMSmarty();
if (isset($_REQUEST['upload_error']) && $_REQUEST['upload_error'] == true) {
    echo '<br><b><font color="red"> The selected file has no data or a invalid file.</font></b><br>';
}
if (isset($_REQUEST['record']) && $_REQUEST['record'] != '') {
    $focus->id = $_REQUEST['record'];
    $focus->mode = 'edit';
    $focus->retrieve_entity_info($_REQUEST['record'], "Notes");
    $focus->name = $focus->column_fields['notes_title'];
    $focus->column_fields['notecontent'] = decode_html($focus->column_fields["notecontent"]);
}
if (isset($_REQUEST['potential_id']) && $_REQUEST['potential_id'] != '') {
    $potential_id = $_REQUEST['potential_id'];
    $sql = "select accountid,contact_id from ec_potential  where deleted=0 and potentialid='" . $potential_id . "'";
    $result = $focus->db->query($sql);
예제 #18
0
    $db = new Ossim_db();
    $conn = $db->connect();
    if ($asset_id && $asset_type) {
        if (!array_key_exists($asset_type, $asset_types)) {
            Av_exception::throw_error(Av_exception::USER_ERROR, _('Error! Invalid Asset Type'));
        }
        $class_name = $asset_types[$asset_type];
        // Check Asset Permission
        if (method_exists($class_name, 'is_allowed') && !$class_name::is_allowed($conn, $asset_id)) {
            $error = sprintf(_('Error! %s is not allowed'), ucwords($asset_type));
            Av_exception::throw_error(Av_exception::USER_ERROR, $error);
        }
        //Note filter
        $_type = $type_tr[$asset_type];
        $filters = array();
        $filters['order_by'] = 'date DESC';
        $filters['where'] = "type='{$_type}' AND asset_id = UNHEX('{$asset_id}')";
        list($notes, $total) = Notes::get_list($conn, $filters);
    } else {
        Av_exception::throw_error(Av_exception::USER_ERROR, _('Error retrieving information'));
    }
} catch (Exception $e) {
    $db->close();
    Util::response_bad_request($e->getMessage());
}
$tooltip = sprintf(_("This %s has %s note(s)."), ucfirst($asset_type), $total);
$data = array('value' => $total, 'level' => 0, 'tooltip' => $tooltip);
$db->close();
echo json_encode($data);
/* End of file get_status_notes.php */
/* Location: /av_asset/common/providers/get_status_notes.php */
예제 #19
0
 * The Original Code is:  vtiger CRM Open Source
 * The Initial Developer of the Original Code is vtiger.
 * Portions created by vtiger are Copyright (C) vtiger.
 * All Rights Reserved.
*
 ********************************************************************************/
require_once 'include/CRMSmarty.php';
require_once 'modules/Notes/Notes.php';
require_once 'include/utils/utils.php';
//Redirecting Header for single page layout
require_once 'user_privileges/default_module_view.php';
global $singlepane_view;
if ($singlepane_view == 'true' && $_REQUEST['action'] == 'CallRelatedList') {
    header("Location:index.php?action=DetailView&module=" . $_REQUEST['module'] . "&record=" . $_REQUEST['record'] . "&parenttab=" . $_REQUEST['parenttab']);
} else {
    $focus = new Notes();
    $currentmodule = $_REQUEST['module'];
    $RECORD = $_REQUEST['record'];
    if (isset($_REQUEST['record']) && $_REQUEST['record'] != '') {
        $focus->retrieve_entity_info($_REQUEST['record'], "Notes");
        $focus->id = $_REQUEST['record'];
        $focus->notes_title = $focus->column_fields['notes_title'];
    }
    global $mod_strings;
    global $app_strings;
    global $theme;
    $theme_path = "themes/" . $theme . "/";
    $image_path = $theme_path . "images/";
    require_once $theme_path . 'layout_utils.php';
    $smarty = new CRMSmarty();
    if (isset($_REQUEST['isDuplicate']) && $_REQUEST['isDuplicate'] == 'true') {
예제 #20
0
파일: notes.php 프로젝트: kimblemj/server
 private static function getNoteCommentsAPI($noteId, $playerId)
 {
     $query = "SELECT note_id FROM notes WHERE parent_note_id = '{$noteId}'";
     $result = Module::query($query);
     $comments = array();
     while ($commentNoteId = mysql_fetch_object($result)) {
         $comment = Notes::getDetailedFullNoteObject($commentNoteId->note_id, $playerId);
         $comments[] = $comment;
     }
     return $comments;
 }
 public static function fetch()
 {
     $res = self::$notes;
     self::$notes = array();
     return $res;
 }
예제 #22
0
    /**
     * Get one last Document's note
     * @param $docid
     * @return array
     */
    public static function getLastNoteById($docid)
    {

        $note = new Notes();
        $condition = new CDbCriteria();
        $condition->condition = "Client_ID='" . Yii::app()->user->clientID . "'";
        $condition->addCondition("Document_ID = '" . $docid . "'");
        $condition->addCondition("Company_ID='0'");
        $condition->order = "Created DESC";
        $ap_note = $note->find($condition);

        if ($ap_note) {
            $comment = $ap_note->Comment;

        } else {
            $comment = '';
        }


        return $comment;
    }
예제 #23
0
    /**
     * Lists all models.
     */
    public function actionIndex()
    {
        if (isset($_POST['oper']) && $_POST['oper'] == 'edit') {
            $noteId = intval($_POST["id"]);
            $note = Notes::model()->findByPk($noteId);

            if ($note) {
                $note->Comment = $_POST["Comment"] ? $_POST["Comment"] : null;
                $note->Created = $_POST["Created"] ? $_POST["Created"] : null;
                if ($note->validate()) {
                    $note->save();
                    echo "note\n";
                }
            }

            die;
        }

        if (isset($_POST['oper']) && $_POST['oper'] == 'add') {
            die;
        }

        if (isset($_POST['oper']) && $_POST['oper'] == 'del') {
            $noteId = intval($_POST["id"]);
            $note = Notes::model()->findByPk($noteId);
            if ($note) {
                $note->delete();
            }
            die;
        }

        $conn = mysql_connect(Yii::app()->params->dbhost, Yii::app()->params->dbuser, Yii::app()->params->dbpassword);
        mysql_select_db(Yii::app()->params->dbname);
        mysql_query("SET NAMES 'utf8'");

        Yii::import('ext.phpgrid.inc.jqgrid');

        // set columns
        $col = array();
        $col["title"] = "Note ID"; // caption of column
        $col["name"] = "Note_ID";
        $col["dbname"] = "notes.Note_ID"; // grid column name, same as db field or alias from sql
        $col["resizable"] = false;
        $col["editable"] = false; // this column is editable
        $col["hidden"] = false;
        $col["viewable"] = true;
        $col["search"] = false;
        $col["sortable"] = true;
        $cols[] = $col;

        // set columns
        $col = array();
        $col["title"] = "Document ID"; // caption of column
        $col["name"] = "Document_ID";
        $col["dbname"] = "notes.Document_ID"; // grid column name, same as db field or alias from sql
        $col["resizable"] = false;
        $col["editable"] = false; // this column is editable
        $col["hidden"] = false;
        $col["viewable"] = true;
        $col["search"] = true;
        $col["sortable"] = true;
        $cols[] = $col;

        // set columns
        $col = array();
        $col["title"] = "User ID"; // caption of column
        $col["name"] = "User_ID";
        $col["dbname"] = "notes.User_ID"; // grid column name, same as db field or alias from sql
        $col["resizable"] = false;
        $col["editable"] = false; // this column is editable
        $col["hidden"] = false;
        $col["viewable"] = true;
        $col["search"] = true;
        $col["sortable"] = true;
        $cols[] = $col;

        // set columns
        $col = array();
        $col["title"] = "Company ID"; // caption of column
        $col["name"] = "Company_ID";
        $col["dbname"] = "notes.Company_ID"; // grid column name, same as db field or alias from sql
        $col["resizable"] = false;
        $col["editable"] = false; // this column is editable
        $col["hidden"] = false;
        $col["viewable"] = true;
        $col["search"] = true;
        $col["sortable"] = true;
        $cols[] = $col;

        $col = array();
        $col["title"] = "Client ID"; // caption of column
        $col["name"] = "Client_ID";
        $col["dbname"] = "notes.Client_ID"; // grid column name, same as db field or alias from sql
        $col["resizable"] = false;
        $col["editable"] = false; // this column is editable
        $col["hidden"] = false;
        $col["viewable"] = true;
        $col["search"] = true;
        $col["sortable"] = true;
        $cols[] = $col;

        $col = array();
        $col["title"] = "Comment"; // caption of column
        $col["name"] = "Comment";
        $col["dbname"] = "notes.Comment"; // grid column name, same as db field or alias from sql
        $col["resizable"] = false;
        $col["editable"] = true; // this column is editable
        $col["hidden"] = false;
        $col["viewable"] = true;
        $col["search"] = true;
        $col["sortable"] = true;
        $cols[] = $col;

        $col = array();
        $col["title"] = "Created"; // caption of column
        $col["name"] = "Created";
        $col["dbname"] = "notes.Created"; // grid column name, same as db field or alias from sql
        $col["resizable"] = true;
        $col["editable"] = true; // this column is editable
        $col["viewable"] = true;
        $col["search"] = false;
        $cols[] = $col;


        $g = new jqgrid();

        $grid["caption"] = "Notes";
        // $grid["multiselect"] = true;
        $grid["autowidth"] = true;
        $grid["resizable"] = true;
        //$grid["toppager"] = true;
        $grid["sortname"] = 'notes.Note_ID';
        $grid["sortorder"] = "ASC";
        $grid["add_options"] = array(
            'width'=>'420',
            "closeAfterEdit"=>true, // close dialog after add/edit
            "top"=>"200", // absolute top position of dialog
            "left"=>"200" // absolute left position of dialog
        );

        $g->set_options($grid);

        $g->set_actions(array(
                "add"=>false, // allow/disallow add
                "edit"=>true, // allow/disallow edit
                "delete"=>true, // allow/disallow delete
                "rowactions"=>true, // show/hide row wise edit/del/save option
                "export"=>true, // show/hide export to excel option
                "autofilter" => true, // show/hide autofilter for search
                "search" => "advance" // show single/multi field search condition (e.g. simple or advance)
            )
        );

        $g->select_command = "SELECT notes.*
                              FROM notes";

        // set database table for CRUD operations
        $g->table = "notes";

        $g->set_columns($cols);

        // group columns header
        $g->set_group_header( array(
                "useColSpanStyle"=>true,
                "groupHeaders"=>array(
                    array(
                        "startColumnName"=>'Note_ID', // group starts from this column
                        "numberOfColumns"=>7, // group span to next 2 columns
                        "titleText"=>'Note Information' // caption of group header
                    ),
                )
            )
        );

        // render grid and get html/js output
        $out = $g->render("notes");

        $this->render('index',array(
            'out'=>$out,
        ));
    }
예제 #24
0
<?php

require_once '..\\class\\Notes.php';
$o = new Notes();
$r = $o->get_notes();
echo json_encode($r);
return;
예제 #25
0
 public function actionDelete()
 {
     $data = $_POST;
     if (!empty($data)) {
         //deletable only by creator
         $note = Notes::model()->findByPk($data['note_id']);
         if ($note->created_by != Yii::app()->user->name) {
             echo CJSON::encode(array('type' => 'error', 'data' => 'CREATEDBY_ERROR: Only the creator can delete the note'));
         } else {
             Notes::model()->deleteByPk($data['note_id']);
             echo CJSON::encode(array('type' => 'success', 'data' => ''));
         }
     } else {
         echo CJSON::encode(array('type' => 'error', 'data' => 'CSRF_ERROR: CSRF Token did not match'));
     }
 }
예제 #26
0
require $root_path . 'include/inc_environment_global.php';
/**
* CARE2X Integrated Hospital Information System beta 2.0.1 - 2004-07-04
* GNU General Public License
* Copyright 2002,2003,2004,2005 Elpidio Latorilla
* elpidio@care2x.org, 
*
* See the file "copy_notice.txt" for the licence notice
*/
$thisfile = basename($_SERVER['PHP_SELF']);
if (!isset($type_nr) || !$type_nr) {
    $type_nr = 1;
}
//* 1 = history physical notes
require_once $root_path . 'include/care_api_classes/class_notes.php';
$obj = new Notes();
$types = $obj->getAllTypesSort('name');
$this_type = $obj->getType($type_nr);
if (isset($_GET['pn'])) {
    $pid = $_GET['pn'];
} else {
    $pid = $_GET['pid'];
}
if (!isset($mode)) {
    $mode = 'show';
} elseif ($mode == 'create' || $mode == 'update') {
    include_once $root_path . 'include/inc_date_format_functions.php';
    # Set the date, default is today
    if (empty($_POST['date'])) {
        $_POST['date'] = date('Y-m-d');
    } else {
예제 #27
0
    $logData = $request->param('logData');
    $agents = $request->param('logAgents');
    $result = Logs::updateLog($id, $logData, $agents);
    if ($result > 0) {
        $response->json(Result::success('Log Updated.'));
    } elseif ($result === 0) {
        $response->json(Result::success('Log not Updated.'));
    } else {
        $response->json(Result::error('Log not found'));
    }
});
$this->respond(['GET', 'POST'], '/get/[i:id]', function ($request, $response, $service, $app) {
    $id = $request->param('id');
    $logData = Logs::getLog($id);
    $agents = Agents::getLogAgents($id);
    $notes = Notes::getLogNotes($id);
    $result = array("logData" => $logData, "logAgents" => $agents, "logNotes" => $notes);
    if ($logData) {
        $response->json(Result::success('', $result));
    } else {
        $response->json(Result::error('Log not found'));
    }
});
$this->respond(['GET', 'POST'], '/delete/[:id]', function ($request, $response, $service, $app) {
    $id = $request->param('id');
    $result = Logs::deleteLog($id);
    if ($result > 0) {
        $response->json(Result::success('Log Deleted.'));
    } else {
        $response->json(Result::error('Log not Deleted'));
    }
예제 #28
0
파일: players.php 프로젝트: kimblemj/server
 private static function getSinglePlayerDataBP($gameId, $playerId, $individual = false, $getItems = true, $getAttributes = true, $getNotes = true)
 {
     $backpack = new stdClass();
     //Get owner information
     $query = "SELECT user_name, display_name, group_name, media_id FROM players WHERE player_id = '{$playerId}'";
     $result = Module::query($query);
     $name = mysql_fetch_object($result);
     if (!$name) {
         return "Invalid Player Id";
     }
     $backpack->owner = new stdClass();
     $backpack->owner->user_name = $name->user_name;
     $backpack->owner->display_name = $name->display_name;
     $backpack->owner->group_name = $name->group_name;
     $backpack->owner->player_id = $playerId;
     $playerpic = Media::getMediaObject('player', $name->media_id)->data;
     if ($playerpic) {
         $backpack->owner->player_pic_url = $playerpic->url_path . $playerpic->file_path;
         $backpack->owner->player_pic_thumb_url = $playerpic->url_path . $playerpic->thumb_file_path;
     } else {
         $backpack->owner->player_pic_url = null;
         $backpack->owner->player_pic_thumb_url = null;
     }
     /* ATTRIBUTES */
     if ($getAttributes) {
         $backpack->attributes = Items::getDetailedPlayerAttributes($playerId, $gameId);
     }
     /* OTHER ITEMS */
     if ($getItems) {
         $backpack->items = Items::getDetailedPlayerItems($playerId, $gameId);
     }
     /* NOTES */
     if ($getNotes) {
         $backpack->notes = Notes::getDetailedPlayerNotes($playerId, $gameId, $individual);
     }
     return $backpack;
 }
예제 #29
0
* elpidio@care2x.org, 
*
* See the file "copy_notice.txt" for the licence notice
*/
$lang_tables = array('date_time.php', 'departments.php');
define('LANG_FILE', 'nursing.php');
$local_user = '******';
//define('NO_2LEVEL_CHK',1);
require_once $root_path . 'include/inc_front_chain_lang.php';
/* Create nursing notes object */
require_once $root_path . 'include/care_api_classes/class_notes_nursing.php';
require_once $root_path . 'include/care_api_classes/class_person.php';
$report_obj = new NursingNotes();
$person_obj = new Person();
require_once $root_path . 'include/care_api_classes/class_notes.php';
$notes_obj = new Notes();
$pid = $person_obj->GetPidFromEncounter($pn);
//if ($station=='') { $station='Non-department specific';  }
if ($pday == '') {
    $pday = date('d');
}
if ($pmonth == '') {
    $pmonth = date('m');
}
if ($pyear == '') {
    $pyear = date('Y');
}
$s_date = $pyear . '-' . $pmonth . '-' . $pday;
$thisfile = basename($_SERVER['PHP_SELF']);
require_once $root_path . 'include/inc_date_format_functions.php';
if ($mode == 'save') {
예제 #30
0
 /**
  * Create a new widget for the dashboard
  */
 public function widgetsAction()
 {
     $auth = Zend_Auth::getInstance();
     $translator = Shineisp_Registry::getInstance()->Zend_Translate;
     $auth->setStorage(new Zend_Auth_Storage_Session('admin'));
     $id = $this->getRequest()->getParam('id', 'widget_' . rand());
     $icon = $this->getRequest()->getParam('icon', 'fa fa-file');
     $type = $this->getRequest()->getParam('type');
     $title = $this->getRequest()->getParam('title');
     $buttons = array();
     if (!empty($id)) {
         $widget = new Shineisp_Commons_Widgets();
         $widget->setId($id);
         // Ajax load of the widgets
         // Get only the new orders
         if ($type == "new_order_widget") {
             $records = Orders::Last(array(Statuses::id("tobepaid", "orders")));
             $buttons = array('edit' => array('label' => $translator->translate('Edit'), 'cssicon' => 'glyphicon glyphicon-pencil', 'action' => "/admin/orders/edit/id/%d"));
             $widget->setBasepath('/admin/orders/')->setIdxfield($records['index'])->setButtons($buttons);
             // Get all the pending, processing, and paid orders to be complete
         } elseif ($type == 'processing_order_widget') {
             $statuses = array(Statuses::id("processing", "orders"), Statuses::id("pending", "orders"), Statuses::id("paid", "orders"));
             $buttons = array('edit' => array('label' => $translator->translate('Edit'), 'cssicon' => 'glyphicon glyphicon-pencil', 'action' => "/admin/orders/edit/id/%d"));
             $records = Orders::Last($statuses);
             $widget->setBasepath('/admin/orders/')->setIdxfield($records['index'])->setButtons($buttons);
             // Get all the services / order items next to the expiration date from -10 days to 30 days
         } elseif ($type == 'recurring_services_widget') {
             $records = OrdersItems::getServices();
             $buttons = array('edit' => array('label' => $translator->translate('Edit'), 'cssicon' => 'glyphicon glyphicon-pencil', 'action' => "/admin/ordersitems/edit/id/%d"));
             $widget->setBasepath('/admin/ordersitems/')->setIdxfield($records['index'])->setButtons($buttons);
             // Get the last 5 tickets opened by the customers
         } elseif ($type == 'last_tickets_widget') {
             $records = Tickets::Last(null, 5);
             $buttons = array('edit' => array('label' => $translator->translate('Edit'), 'cssicon' => 'glyphicon glyphicon-pencil', 'action' => "/admin/tickets/edit/id/%d"));
             $widget->setBasepath('/admin/tickets/')->setIdxfield($records['index'])->setButtons($buttons);
             // get the last domain tasks to be executed
         } elseif ($type == 'last_domain_tasks_widget') {
             $records = DomainsTasks::Last();
             $buttons = array('edit' => array('label' => $translator->translate('Edit'), 'cssicon' => 'glyphicon glyphicon-pencil', 'action' => "/admin/domainstasks/edit/id/%d"));
             $widget->setBasepath('/admin/domainstasks/')->setIdxfield($records['index'])->setButtons($buttons);
             // get the last ISP panel tasks to be executed
         } elseif ($type == 'last_panel_tasks_widget') {
             $records = PanelsActions::Last();
             $buttons = array('edit' => array('label' => $translator->translate('Edit'), 'cssicon' => 'glyphicon glyphicon-pencil', 'action' => "/admin/panelsactions/edit/id/%d"));
             $widget->setBasepath('/admin/panelsactions/')->setIdxfield($records['index'])->setButtons($buttons);
             // get the domains next the expiration date
         } elseif ($type == 'expiring_domain_widget') {
             // Create the header table columns
             $records['fields'] = array('expiringdate' => array('label' => $translator->translate('Expiry Date')), 'domains' => array('label' => $translator->translate('Domain')), 'days' => array('label' => $translator->translate('Days left')));
             $buttons = array('edit' => array('label' => $translator->translate('Edit'), 'cssicon' => 'glyphicon glyphicon-pencil', 'action' => "/admin/domains/edit/id/%d"));
             $records['data'] = Domains::getExpiringDomains(null, 107, -1, 5);
             $records['index'] = "domain_id";
             $widget->setBasepath('/admin/domains/')->setIdxfield($records['index'])->setButtons($buttons);
             // get the messages/notes posted by the customers within the orders
         } elseif ($type == 'order_messages_widget') {
             $records = Messages::Last('orders');
             $buttons = array('edit' => array('label' => $translator->translate('Edit'), 'cssicon' => 'glyphicon glyphicon-pencil', 'action' => "/admin/orders/edit/id/%d"));
             $widget->setBasepath('/admin/orders/')->setIdxfield($records['index'])->setButtons($buttons);
             // get the messages/notes posted by the customers within the domain
         } elseif ($type == 'domain_messages_widget') {
             $records = Messages::Last('domains');
             $buttons = array('edit' => array('label' => $translator->translate('Edit'), 'cssicon' => 'glyphicon glyphicon-pencil', 'action' => "/admin/domains/edit/id/%d"));
             $widget->setBasepath('/admin/domains/')->setIdxfield($records['index'])->setButtons($buttons);
             // get the list of your best customers
         } elseif ($type == 'customers_parade_widget') {
             $buttons = array('edit' => array('label' => $translator->translate('Show'), 'cssicon' => 'glyphicon glyphicon-pencil', 'action' => "/admin/customers/edit/id/%d"));
             $records = Customers::Hitparade();
             $widget->setBasepath('/admin/customers/')->setIdxfield($records['index'])->setButtons($buttons);
             // get the customer status summary
         } elseif ($type == 'customer_summary_widget') {
             $records = Customers::summary();
             // get the tickets summary
         } elseif ($type == 'ticket_summary_widget') {
             $records = Tickets::summary();
             // get the domains summary
         } elseif ($type == 'summary_domains_widget') {
             $records = Domains::summary();
             // get the product reviews stats
         } elseif ($type == 'product_reviews_widget') {
             $records = Reviews::summary();
             // get the bestseller product stats
         } elseif ($type == 'bestseller_widget') {
             $buttons = array('edit' => array('label' => $translator->translate('Show'), 'cssicon' => 'glyphicon glyphicon-pencil', 'action' => "/admin/products/edit/id/%d"));
             $records = Products::summary();
             $widget->setBasepath('/admin/products/')->setIdxfield($records['index'])->setButtons($buttons);
             // get the last ISP notes
         } elseif ($type == 'notes_widget') {
             $user = $auth->getIdentity();
             $records = Notes::summary($user['user_id']);
             $widget->setBasepath('/admin/notes/');
         } else {
             die('No widget type has been selected: ' . $type);
         }
         // Records Builtin columns. The code get the field names as header column name
         if (!empty($records['fields'])) {
             foreach ($records['fields'] as $field => $column) {
                 $column['alias'] = !empty($column['alias']) ? $column['alias'] : $field;
                 $widget->setColumn($field, $column);
             }
         }
         if (!empty($records['data'])) {
             $widget->setIcon($icon)->setLabel($title)->setRecords($records['data']);
             die($widget->create());
         }
     }
     die;
 }