コード例 #1
0
 public function run()
 {
     $faker = Faker::create();
     foreach (range(1, 10) as $index) {
         Notification::create([]);
     }
 }
コード例 #2
0
 public function run()
 {
     $faker = Faker::create();
     $faker->addProvider(new \Faker\Provider\Base($faker));
     foreach (range(1, 10) as $index) {
         Notification::create(['title' => $faker->text, 'owner_type' => $faker->randomElement($array = array('terefa', 'cliente', 'agendaevent')), 'owner_id' => $faker->randomElement($array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)), 'user_id' => '1', 'type' => $faker->randomElement($array = array('email', 'notification')), 'status' => $faker->boolean($chanceOfGettingTrue = 50), 'date' => $faker->dateTime($max = 'now')]);
     }
 }
 public function run()
 {
     Notification::create(['name' => 'retries', 'friendly_name' => 'Server Retry Threshold', 'value' => '5', 'options' => null, 'description' => 'After this many minutes of not being able to connect to a server, issue a notification']);
     Notification::create(['name' => 'email.enabled', 'friendly_name' => 'E-Mail Notifications Enabled', 'value' => 'false', 'options' => 'true|false', 'description' => 'Whether or not E-Mail notifications are enabled']);
     Notification::create(['name' => 'email.addresses', 'friendly_name' => 'E-Mail Addresses', 'value' => '', 'options' => null, 'description' => 'The email addresses that notifcations are sent to, seperated by a semi-colon (;)', 'in_overview' => 0]);
     Notification::create(['name' => 'twitter.enabled', 'friendly_name' => 'Twitter Notifications Enabled', 'value' => 'false', 'options' => 'true|false', 'description' => 'Whether or not Twitter notifications are enabled']);
     Notification::create(['name' => 'twitter.key', 'friendly_name' => 'Twitter Consumer Key', 'value' => '', 'options' => null, 'description' => 'Your twitter account consumer key found on https://apps.twitter.com', 'in_overview' => 0]);
     Notification::create(['name' => 'hipchat.enabled', 'friendly_name' => 'HipChat Notifications Enabled', 'value' => 'false', 'options' => 'true|false', 'description' => 'Whether or not HipChat notifications are enabled']);
     Notification::create(['name' => 'hipchat.room', 'friendly_name' => 'HipChat Room ID', 'value' => '', 'options' => null, 'description' => 'HipChat room ID to send notifications to', 'in_overview' => 0]);
     Notification::create(['name' => 'hipchat.auth', 'friendly_name' => 'HipChat Room Auth Token', 'value' => '', 'options' => null, 'description' => 'The HipChat rooms auth token', 'in_overview' => 0]);
     Notification::create(['name' => 'pushbullet.enabled', 'friendly_name' => 'PushBullet Notifications Enabled', 'value' => 'false', 'options' => 'true|false', 'description' => 'Whether or not PushBullet notifications are enabled']);
 }
コード例 #4
0
 /**
  * @covers ::create
  * @depends testGet
  */
 public function testCreate()
 {
     $expected = new \TMT\model\Notification(array("guid" => "guid1", "timestamp" => "2000-01-01 00:00:00", "message" => "message", "area" => "areaguid", "type" => "type1"));
     $mockdb = new \TMT\MockDB();
     $mockdb->expectPrepare("INSERT INTO notifications (message, type, area, guid) VALUES (:message, :type, :area, :guid)");
     $mockdb->expectExecute(array(':message' => "message", ':type' => "type1", ':area' => "areaguid", ":guid" => "guid1"));
     $mockdb->expectPrepare("SELECT * FROM notifications WHERE guid=:guid");
     $mockdb->expectExecute(array(':guid' => "guid1"));
     $mockdb->setReturnData(array((object) array("guid" => "guid1", "timestamp" => "2000-01-01 00:00:00", "message" => "message", "area" => "areaguid", "type" => "type1")));
     $accessor = new Notification($mockdb);
     $accessor->setGuidCreator(new MockGuidCreator("guid1"));
     $actual = $accessor->create(new \TMT\model\Notification(array("message" => "message", "area" => "areaguid", "type" => "type1")));
     $this->assertEquals($expected, $actual);
     $mockdb->verify();
 }
コード例 #5
0
 public function createDesignation()
 {
     $in = Input::all();
     $rules = ['group' => 'required', 'deadline' => 'required', 'time' => 'required'];
     $validation = Validator::make($in, $rules);
     if ($validation->passes()) {
         $activity = GroupPageActivity::find($in['grouppageactivityID']);
         $gpaGroup = GroupPageActivityGroup::create(['grouppageactivityID' => $in['grouppageactivityID'], 'grouppageID' => $in['group'], 'deadline' => $in['deadline'] . ' ' . $in['time']]);
         if ($gpaGroup) {
             $gpPost = GroupPagePost::create(['grouppageID' => $in['group'], 'StudentID' => Auth::user()->StudentID, 'Message' => '<h5>Activity name:</h5>' . $activity->name . '<br/><h5>Description:</h5>' . $activity->description . '<br/><span class="timeago">Deadline: ' . date(MyDate::getDateFormat(), strtotime($in['deadline'])) . '</span><p>Kindly check your activities Tab</p>']);
             Notification::create(['StudentID' => Auth::user()->StudentID, 'grouppageID' => $in['group'], 'grouppageactivityID' => $in['grouppageactivityID'], 'grouppagepostID' => $gpPost->id, 'notificationEventTypeID' => 1, 'seen' => 0]);
         }
         return Redirect::to('/')->with('message', 'Group activity designation successful')->with('url', '/group/activities/view/' . $in['grouppageactivityID']);
     }
     return Redirect::to('/')->with('message', 'Error in group activity designation')->with('url', '/group/activities/view/' . $in['grouppageactivityID']);
 }
コード例 #6
0
ファイル: Order.php プロジェクト: puttyplayer/CSGOShop
    public function confirm($app)
    {
        $this->status = Order::STATUS_PAID_CONFIRM;
        $this->save();
        $listings = array();
        foreach ($this->listings as $idx => $listing) {
            Notification::create(['user_id' => $this->user_id, 'receiver_id' => $listing->user_id, 'title' => 'APPROVAL', 'body' => '**Listing #' . $app->hashids->encrypt($listing->id) . ' (' . $listing->description->name . ') has been ordered!** 
Someone has purchased your item! Once they have completed their order and received the item, funds will be deposited in your CSGOShop wallet.
You can read more about your wallet [here](' . $app->config->get('core.url') . '/help#wallet).']);
            array_push($listings, array('order_id' => (string) $this->id, 'user_id' => (string) $this->user_id, 'item_id' => (string) $listing->item_id, 'bot_id' => (string) $listing->bot_id));
            $app->pusher->trigger($listing->user_id, 'notification', array('message' => '1'));
        }
        Notification::create(['user_id' => $this->user_id, 'receiver_id' => $this->user_id, 'title' => 'APPROVAL', 'body' => '**Payment for Order #' . $app->hashids->encrypt($this->id) . 'has been confirmed!** 
Your order has been confirmed and a bot will send you a trade offer soon with your purchased items.']);
        $app->pusher->trigger($this->user_id, 'notification', array('message' => '1'));
        $app->pusher->trigger('bots', 'paidOrder', $listings);
    }
コード例 #7
0
 public function store_followup($id)
 {
     $patient = Patient::find($id);
     $patient->first_name = Input::get("firstname");
     $patient->middle_name = Input::get("middlename");
     $patient->last_name = Input::get("lastname");
     $patient->birth_date = Input::get("dob");
     $patient->hospital_id = Input::get("hosp_no");
     $patient->phone = Input::get("phone");
     $patient->facility_id = Input::get("facility");
     $patient->save();
     //adding patient visit info
     $visit = Visit::create(array("patient_id" => $patient->id, "visit_date" => date('Y-m-d'), "server_status" => 'not', "user" => Auth::user()->firstname . " " . Auth::user()->middlename . " " . Auth::user()->lastname));
     //adding address information
     PatientInfo::create(array("patient_id" => $patient->id, "visit_id" => $visit->id, "hospital_id" => "somenumber", "region" => Input::get("region"), "district" => Input::get("district"), "ward" => Input::get("ward"), "ten_cell_leader" => Input::get("t_cell_leadr")));
     //adding gynecological history inforamtion for a visit
     GynecologicalHistory::create(array("patient_id" => $patient->id, "visit_id" => $visit->id, "parity" => Input::get("parity"), "number_of_pregnancy" => Input::get("number_of_preg"), "menarche" => Input::get("menarche"), "age_at_sexual_debut" => Input::get("start_sex_age"), "marital_status" => Input::get("marital"), "age_at_first_marriage" => Input::get("first_marriage"), "sexual_partner" => Input::get("sexual_partner"), "partner_sexual_partner" => Input::get("partner_sexual_partner")));
     //adding contraceptive history
     ContraceptiveHistory::create(array("patient_id" => $patient->id, "visit_id" => $visit->id, "current_status" => Input::get("current_on_contra"), "current_contraceptive_id" => Input::has("current_contra") ? Input::get("current_contra") : ""));
     //adding HIV status
     HivStatus::create(array("patient_id" => $patient->id, "visit_id" => $visit->id, "status" => Input::has("hiv_status") ? Input::get("hiv_status") : "", "test_status" => Input::has("hiv_test_status") ? Input::get("hiv_test_status") : "", "unknown_reason" => Input::has("unknown_reason") ? Input::get("unknown_reason") : "", "years_since_first_diagnosis" => Input::has("year_since_diagnosis") ? Input::get("year_since_diagnosis") : "", "year_of_last_test" => Input::has("last_test") ? Input::get("last_test") : "", "art_status" => Input::has("art_status") ? Input::get("art_status") : "", "current_art_status" => Input::has("current_art_status") ? Input::get("current_art_status") : "", "pitc_offered" => Input::get("test_again") == "yes" ? "yes" : "no", "pitc_agreed" => Input::has("test_again") ? Input::get("test_again") : "", "pitc_result" => Input::has("current_test_result") ? Input::get("current_test_result") : "", "pitc_cd4_count" => Input::has("current_cd4") ? Input::get("current_cd4") : "", "prev_cd4_count" => Input::has("prev_cd4") ? Input::get("prev_cd4") : ""));
     //adding VIA Status
     ViaStatus::create(array("patient_id" => $patient->id, "visit_id" => $visit->id, "via_counselling_status" => Input::get("via_counceling"), "via_test_status" => Input::get("via_test"), "reject_reason" => Input::has("via_reason") ? Input::get("via_reason") : "", "via_result" => Input::has("via_results") ? Input::get("via_results") : ""));
     //adding colposcopy
     ColposcopyStatus::create(array("patient_id" => $patient->id, "visit_id" => $visit->id, "status" => Input::get("colposcopy_status"), "result_id" => Input::has("colpo_result") ? Input::get("colpo_result") : ""));
     //adding Pap smear result
     PapsmearStatus::create(array("patient_id" => $patient->id, "visit_id" => $visit->id, "status" => Input::get("pap_status"), "result_id" => Input::has("pap_result") ? Input::get("pap_result") : ""));
     //adding intervetion status
     Intervention::create(array("patient_id" => $patient->id, "visit_id" => $visit->id, "type_id" => Input::has("intervention") ? Input::get("intervention") : "", "indicator_id" => Input::has("indicator") ? Input::get("indicator") : "", "histology_id" => Input::has("histology") ? Input::get("histology") : "", "cancer_id" => Input::has("cancer") ? Input::get("cancer") : "", "grade" => Input::has("hist_grade") ? Input::get("hist_grade") : "", "stages" => Input::has("stages") ? Input::get("stages") : "", "differentiation" => Input::has("differentiation") ? Input::get("differentiation") : ""));
     $report = PatientReport::where('patient_id', $patient->id)->first();
     $report->region = Input::get("region");
     $report->district = Input::get("district");
     $report->number_of_pregnancy = Input::get("number_of_preg");
     $report->marital_status = Input::get("marital");
     $report->first_marriage = Input::get("first_marriage");
     $report->partners = Input::get("sexual_partner");
     $report->partners_partner = Input::get("partner_sexual_partner");
     $report->contraceptive_status = Input::get("current_on_contra");
     $report->facility_id = Input::get("facility");
     if (Input::has("current_contra")) {
         $report->contraceptive_type = Input::get("current_contra");
     }
     if (Input::has("hiv_status")) {
         $report->HIV_status = Input::get("hiv_status");
     }
     if (Input::has("current_cd4")) {
         $report->cd4_count = Input::get("current_cd4");
     } elseif (Input::has("prev_cd4")) {
         $report->cd4_count = Input::has("prev_cd4");
     }
     $report->save();
     if (Input::get("next_visit") != "") {
         Notification::create(array("patient_id" => $patient->id, "message" => "Kumbuka Kwenda katika kituo ulichopimwa mara ya mwisho saratani ya shingo ya kizazi. Tafadhali fika bila kukosa tarehe  " . Input::get('next_visit'), "status" => "pending", "phone_number" => $patient->phone, "next_visit" => Input::get('next_visit')));
     }
     Logs::create(array("user_id" => Auth::user()->id, "action" => "Patient followup for " . $patient->first_name . " " . $patient->last_name));
     $msg = "Patient followup stored successfull";
     return View::make('visit.index', compact('patient', "msg"));
 }
コード例 #8
0
 public function notify($app, $user_id)
 {
     if (!$app->user->isLoggedIn() || !$app->user->isRank('Support Technician')) {
         $app->logger->log('Unauthorized access to Admin CP', 'ALERT', array(), 'admin');
         $app->output->redirect('/');
     }
     try {
         $user = User::find($user_id);
         $request = $app->router->flight->request();
         if ($request->method == 'POST') {
             Notification::create(['user_id' => $app->user->id, 'receiver_id' => $user->id, 'title' => $request->data->title, 'body' => 'Message sent from [' . $app->user->name . '](http://steamcommunity.com/profile/' . $app->user->id . '):' . $request->data->body]);
             $app->output->redirect('/admin/users');
         } else {
             $app->output->addBreadcrumb('admin', 'Dashboard');
             $app->output->addBreadcrumb('admin/users', 'Manage Users');
             $app->output->addBreadcrumb('admin/notify/' . $user_id, 'Notify User');
             $app->output->setTitle('Notify User');
             $app->output->setActiveTab('admin');
             $app->output->render('admin.notify', ['user_to_notify' => $user]);
         }
     } catch (ActiveRecord\RecordNotFound $e) {
         $app->logger->log('No such User found', 'ERROR', array('object' => 'User', 'id' => $user_id, 'pathway' => 'ban'), 'admin');
         $app->output->notFound();
     }
 }
コード例 #9
0
 /**
  * Store a newly created notification in storage.
  *
  * @return Response
  */
 public function store()
 {
     //    	if( isset( $_POST['mandrill_events'] ) ){
     //    		// NOTIFICAÇÃO DO MANDRILL
     // $msg     = array();
     // $dados   = @$_POST['mandrill_events'];
     // $dados   = json_decode($dados);
     // // Mail Defaults
     // $msg['from']      = '*****@*****.**';
     // $msg['from_name'] = 'L. Tonet';
     // $msg['to']        = '*****@*****.**';
     // // SEND THE MAIL
     // Mail::send('notifications.email', compact('dados'), function($message)use($msg){
     // //$message->from('*****@*****.**', 'L. Tonet');
     // //$message->from( $msg['from'], @$msg['from_name'] );
     // $message->to( $msg['to'] );
     // $message->subject('Notificação do Mandrill');
     // });
     // // NOTIFICATION
     // $notification          = new Notification;
     // $notification->title   = 'E-mail aberto';
     // $dados                 = '<pre>'.$dados.'</pre>';
     // $notification->message = $dados;
     // $notification->save();
     // return;
     //    	}
     $validator = Validator::make($data = Input::all(), Notification::$rules);
     if ($validator->fails()) {
         return Redirect::back()->withErrors($validator)->withInput();
     }
     // echo "<pre>";
     //       print_r($data);
     //       echo "</pre>";
     //       exit;
     Notification::create($data);
     // $alert = array(
     // 	'alert-success' => '<strong><i class="fa fa-check"></i></strong> Notificação criada!'
     // );
     $alert[] = ['class' => 'alert-success', 'message' => '<strong><i class="fa fa-check"></i></strong> Notificação criada!'];
     Session::flash('alerts', $alert);
     return Redirect::to(URL::previous());
 }
コード例 #10
0
ファイル: invite.php プロジェクト: NemOry/Skoolyf
                         $group = Group::get_by_id($_GET['groupid']);
                         $object = new GroupUser();
                         $object->userid = $user->id;
                         $object->groupid = $group->id;
                         $object->level = 0;
                         $object->role = "student";
                         $object->enabled = 1;
                         $object->pending = 1;
                         $object->create();
                         $notification = new Notification();
                         $notification->fromuserid = $session->user_id;
                         $notification->touserid = $user->id;
                         $notification->itemid = $object->id;
                         $notification->itemtype = "groupuser";
                         $notification->title = "Invites you";
                         $notification->create();
                         $response = "success";
                     } else {
                         $theuser = GroupUser::getUser($user->id, $_GET['groupid']);
                         if ($theuser->pending == 0) {
                             $response = "This user is already a member.";
                         } else {
                             $response = "This user is already pending.";
                         }
                     }
                 }
             }
         }
     }
 }
 $log = new Log($session->user_id, $clientip, "WEB", "INVITED: " . $user->id);
コード例 #11
0
<?php

namespace Kyoushu\DesktopNotifications;

require_once __DIR__ . '/vendor/autoload.php';
Notification::create('Test Message')->setExpireTime(15000)->send();
コード例 #12
0
ファイル: AmtcwebSpooler.php プロジェクト: maratoid/amtc
 static function execJob($job, $opt)
 {
     if (isset($opt['n'])) {
         echo "Dry-Run-Skip execJob: " . $job->id . ": " . $job->description . "\n";
         return;
     }
     switch ($job->job_type) {
         case Job::JOB_INTERACTIVE:
             $job->job_status = Job::STATUS_RUNNING;
             $job->last_started = time();
             $job->save();
             self::execAmtCommand($job, $opt);
             $job->last_done = time();
             $job->job_status = Job::STATUS_DONE;
             $job->save();
             // how to trigger increased monitoring until job completed?
             if ($notification = Notification::create()) {
                 $notification->message = "Job {$job->id} completed";
                 $notification->ntype = "envelope";
                 $notification->user_id = 2;
                 // hardcoded spooler user
                 $notification->save();
             }
             break;
         case Job::JOB_SCHEDULED:
             $job->job_status = Job::STATUS_RUNNING;
             $job->last_started = time();
             $job->save();
             self::execAmtCommand($job, $opt);
             $job->last_done = time();
             $job->job_status = Job::STATUS_PENDING;
             $job->save();
             if ($notification = Notification::create()) {
                 $notification->message = "{$job->description} completed";
                 // choose powerup-powerdown icons here! use execAmtCommand retval?
                 switch ($job->amtc_cmd) {
                     case 'U':
                         $notification->ntype = 'toggle-on';
                         break;
                     case 'D':
                         $notification->ntype = 'toggle-off';
                         break;
                     default:
                         $notification->ntype = 'envelope';
                 }
                 $notification->user_id = 2;
                 // hardcoded spooler user
                 $notification->save();
             }
             break;
         case Job::JOB_MONITORING:
             // find OUs that have monitoring enabled, join by optionset_id
             self::execMonitoringJob($job, $opt);
             break;
     }
     # sendNotification  -> notification 'powered up x in y seconds'
 }
コード例 #13
0
 /**
  * Store a newly created tarefa in storage.
  *
  * @return Response
  */
 public function store()
 {
     $validator = Validator::make($data = Input::all(), Tarefa::$rules, Tarefa::$messages);
     if ($validator->fails()) {
         return Redirect::back()->withErrors($validator)->withInput();
     }
     // echo "<pre>";
     // print_r( $data );
     // echo "</pre>";
     // exit;
     $tarefa = Tarefa::create($data);
     if ($tarefa) {
         // ADICIONAR NOTIFICAÇÃO
         if (!empty($data['notification']) and $data['notification'] > 0) {
             $notificationDate = Carbon::createFromFormat('Y-m-d H:i:s', $data['date'])->subDays($data['notification']);
             // CREATE NOTIFICACAO...
             Notification::create(['date' => $notificationDate->format('Y-m-d'), 'icon' => 'fa-info-circle', 'title' => $data['notification-text'], 'owner_id' => $tarefa->id, 'owner_type' => 'tarefa']);
         }
         $alert[] = ['class' => 'alert-success', 'message' => '<strong><i class="fa fa-check"></i></strong> Nova tarefa criada!'];
         Session::flash('alerts', $alert);
         return Redirect::back();
     }
     return Redirect::back()->withErrors($validator)->withInput(Input::all());
     //     if( !Input::get('id') ){
     //     }else{
     //        /**
     //         * MOVAR PARA UPDATE?
     //         * MARCA TAREFA COMO CONCLUÍDA OU NÃO
     //         * @var [type]
     //         */
     //        $id = Input::get('id');
     //        $tarefa = Tarefa::findOrFail($id);
     //        $tarefa->check();
     //        print_r($tarefa);
     //        return $tarefa;
     //     }
     // return Redirect::route('tarefas.index');
 }
コード例 #14
0
 /**
  * Create a notification for a user
  *
  * @param $user_id
  * @param $notification_type
  * @param $data
  * @param $url
  * @return static
  */
 public function notify($user_id, $notification_type, $data, $url)
 {
     $notification = Notification::create(['user_id' => $user_id, 'notification_type' => $notification_type, 'data' => json_encode($data), 'url' => $url]);
     return $notification;
 }
コード例 #15
0
    public function invalid_trade_url($app)
    {
        $request = $app->router->flight->request();
        if ($request->method != 'POST') {
            $this->error($app, 'Invalid entry');
        }
        $this->authorize($app, $request->data->key, $request->query->sig, $request->data);
        $user_id = $request->data->user_id;
        if (empty($user_id)) {
            $this->error($app, 'Invalid user id');
        }
        try {
            $user = User::find($user_id);
            $notification = Notification::create(['user_id' => $user->id, 'receiver_id' => $user->id, 'title' => 'DENIAL', 'body' => '**A trade request could not be sent!** 
We were unable to send you a trade offer -- ensure that your Steam trade URL is valid in your [settings](' . $app->config->get('core.url') . '/account/settings).']);
            $app->output->json(array('error' => false, 'message' => 'Notification of invalid trade URL has been sent to user ' . $user->id . '.'));
        } catch (ActiveRecord\RecordNotFound $e) {
            $this->error($app, 'No such user found');
        }
    }
コード例 #16
0
 public function reply($app, $id)
 {
     if (!$app->user->isLoggedIn()) {
         $app->output->redirect('/');
     }
     try {
         $id_dec = $app->hashids->decrypt($id);
         $ticket = SupportTicket::find('first', ['conditions' => ['id = ? AND status != ?', $id_dec, SupportTicket::STATUS_CLOSED], 'include' => ['user']]);
         if (!$ticket || !($app->user->isRank('Support Technician') || $app->user->id == $ticket->user_id)) {
             $app->output->redirect('/support');
         }
         $request = $app->router->flight->request();
         $reply = SupportReply::create(['support_id' => $ticket->id, 'user_id' => $app->user->id, 'body' => $request->data->body ? $request->data->body : '']);
         $reply->reload();
         $ticket->last_reply = $reply->created_at;
         $ticket->status = $app->user->isRank('Support Technician') && $app->user->id != $ticket->user_id ? SupportTicket::STATUS_CUSTOMERREPLY : SupportTicket::STATUS_STAFFREPLY;
         $ticket->save();
         if ($ticket->status == SupportTicket::STATUS_CUSTOMERREPLY) {
             $notification = Notification::create(['user_id' => $app->user->id, 'receiver_id' => $ticket->user_id, 'title' => 'SUPPORT', 'body' => 'A staff member has responded to your open support ticket ([#' . $app->hashids->encrypt($ticket->id) . '](' . $app->config->get('core.url') . '/support/view/' . $app->hashids->encrypt($ticket->id) . ')).']);
         } else {
             if ($ticket->status == SupportTicket::STATUS_STAFFREPLY) {
                 $replies = SupportReply::find('all', ['conditions' => ['support_id = ?', $ticket->id], 'order' => 'id ASC']);
                 $ticket_user = $ticket->user_id;
                 $staff = array_filter(array_unique(array_map(function ($reply) {
                     return $reply->user_id;
                 }, $replies)), function ($staff_member) use($ticket_user) {
                     return $staff_member != $ticket_user;
                 });
                 foreach ($staff as $idx => $staff_member) {
                     $notification = Notification::create(['user_id' => $ticket->user_id, 'receiver_id' => $staff_member, 'title' => 'SUPPORT', 'body' => 'A user has responded to an open support ticket ([#' . $app->hashids->encrypt($ticket->id) . '](' . $app->config->get('core.url') . '/support/view/' . $app->hashids->encrypt($ticket->id) . ')) that you have addressed.']);
                 }
             }
         }
         $app->output->redirect('/support/view/' . $id);
     } catch (Hashids_Invalid $e) {
         $app->logger->log('SupportTicket ID given was invalid', 'ERROR', array('object' => 'SupportTicket', 'id' => $id, 'pathway' => 'reply'), 'user');
         $app->output->notFound();
     }
 }
コード例 #17
0
ファイル: OffPodsController.php プロジェクト: sharad23/power
 private function sendNotification($param = array())
 {
     $users = $this->getPowerStaffs();
     foreach ($users as $user) {
         if ($param['type'] == 'off') {
             Notification::create(array('pod_id' => $param['pod_id'], 'user_id' => $user->staff_login_id, 'descriptions' => $param['description'], 'notification_status' => '0'));
         } else {
             PodUpNotification::create(array('pod_id' => $param['pod_id'], 'user_id' => $user->staff_login_id, 'descriptions' => $param['description'], 'notification_status' => '0'));
         }
     }
 }
コード例 #18
0
    public function cancel($app)
    {
        if (!$app->user->isLoggedIn()) {
            $app->output->redirect('/account/login');
        }
        try {
            if (!isset($_SESSION['order'])) {
                throw new ActiveRecord\RecordNotFound();
            }
            $order = Order::find($_SESSION['order']);
            $order->status = Order::STATUS_CANCELLED;
            $order->save();
            unset($_SESSION['order']);
            foreach ($order->listings as $idx => $listing) {
                $listing->setStage('list');
                Notification::create(['user_id' => $order->user_id, 'receiver_id' => $listing->user_id, 'title' => 'DENIAL', 'body' => '**An Order for Listing #' . $app->hashids->encrypt($listing->id) . ' (' . $listing->description->name . ') has been cancelled!** 
An order for your item has been cancelled and re-listed. We apologize for the inconvenience and will look into this issue with the user who made the purchase.']);
            }
            Notification::create(['user_id' => $order->user_id, 'receiver_id' => $order->user_id, 'title' => 'DENIAL', 'body' => '**Order #' . $app->hashids->encrypt($order->id) . ' has been cancelled!** Beware that cancelling orders will result in a suspension if repeated due to reservation of item.']);
            $app->pusher->trigger($order->user_id, 'notification', array('message' => '1'));
            $app->output->redirect('/cart');
        } catch (ActiveRecord\RecordNotFound $e) {
            $app->logger->log('No such Order found', 'ERROR', array('object' => 'Order', 'id_dec' => $_SESSION['order'], 'pathway' => 'cancelOrder'), 'user');
            $app->output->redirect('/cart');
        }
    }
コード例 #19
0
 public function test()
 {
     Notification::create(['message' => "Создана новая ВКС <a target='_blank' href='" . ST::route("Vks/show/512") . "'>#512</a>", 'type' => NOTIFICATION_VKS_ACTION]);
 }
コード例 #20
0
 /**
  *    TRACK EMAIL OPENS
  **/
 public function track($id)
 {
     if (isset($id) && !empty($id)) {
         if (isset($_GET['email']) && !empty($_GET['email'])) {
             $email = Email::find($id);
             if ($email) {
                 if ($_GET['email'] == $email->to and $email->status != 'sucess' and $email->status != 'danger') {
                     $email->status = 'success';
                     // Aberto pelo destinatário
                     $email->last_open = $_GET['email'];
                     // Notificação de leitura de email
                     Notification::create(['icon' => 'fa-check', 'title' => $email->to . ' recebeu seu e-mail!<br/><small><span class="timeago" title="' . date('Y-m-d H:i:s') . '"></span></small>', 'status' => false]);
                 }
                 $email->save();
             } else {
                 return "Não encontrado";
             }
             //Full URI to the image
             $graphic_http = 'http://basaltosegranitos.com.br/img/blank.gif';
             //Get the filesize of the image for headers
             $filesize = filesize('img/blank.gif');
             //Now actually output the image requested (intentionally disregarding if the database was affected)
             header('Pragma: public');
             header('Expires: 0');
             header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
             header('Cache-Control: private', false);
             header('Content-Disposition: attachment; filename="blank.gif"');
             header('Content-Transfer-Encoding: binary');
             header('Content-Length: ' . $filesize);
             //Begin the header output
             //header( 'Content-Type: image/gif' );
             readfile($graphic_http);
         } else {
             return "Informe o e-mail";
         }
     } else {
         return "Informe o id";
     }
 }
コード例 #21
0
ファイル: user.php プロジェクト: brandonfrancis/scsapi
 /**
  * Notifies this user.
  * @param string $message The message to notify them with.
  * @param string $controller The controller for the link, optional
  * @param string $replacements The replacements for the controller link, optional
  * @param string $imageUrl The url for the image for this notification, optional
  * @return Notification
  */
 public function notify($message, $controller = '', $replacements = array(), $imageUrl = '')
 {
     $notification = Notification::create($this, $message, $controller, $replacements, $imageUrl);
     Push::getPushServer($this)->emit($this->getUserId(), 'notification');
     return $notification;
 }