public function insert() { if ($this->input->post()) { $this->load->library('form_validation'); $this->form_validation->set_rules('message', 'Message', 'required'); $this->form_validation->set_rules('profile', 'Profile', 'required'); if ($this->form_validation->run()) { $type = 2; //system message $message = $this->input->post("message"); $profile_id = $this->input->post("profile"); $data = ["message" => $message, "user_id" => 0, "profile_id" => $profile_id, "type" => $type, "date_input" => date("Y-m-d H:i:s")]; if ($id_message = $this->message->proses_dbase("insert", $this->security->xss_clean($data))) { $this->lib_message->set_message($type, 1, ["message" => $message, "profile_id" => $profile_id, "id_message" => $id_message]); flash_msg('success', '<b>Success!</b> New message has been added.'); redirect('message/listing'); } } else { $data["all_message"] = $this->message->get_all_data(10, 0); $this->load->view('header'); $this->load->view('message_listing', $data); $this->load->view('footer'); } } else { redirect("message/listing", "refresh"); } }
<html lang="en"> <head> <title>XMR</title> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css"> </head> <body> <div class="container"> <div class="page-header"> <h1>XMR integration <small>by TheKoziTwo</small></h1> </div> <?php if (User::is_logged_in()) { ?> <?php echo flash_msg(); ?> <div class="panel panel-success"> <div class="panel-heading"> <h3 class="panel-title">Welcome <strong><?php echo $user->username(); ?> </strong></h3> </div> <div class="panel-body">This is a basic integration of monero where all essential parts have been coded. Feel free to use the code for anything you please.<?php echo $user->is_admin() ? '<br/><br/>You have admin permissions, click <a href="admin.php">here</a> to go to admin panel' : ''; ?> </div> </div>
</tbody> </table> </form> </section> <section> <a class="anchor" id="entries"></a> <h3>Cache Entries</h3> <?php flash_msg($create_test_entry, 'Entry created'); flash_msg($delete_all, 'Cache flushed'); flash_msg($delete_old, 'All old entries deleted'); ?> <p class="">Sometimes it is necessary to sweep the cache from old entries or to flush it.</p> <form accept-charset="utf-8" method="post" class="well" action="#entries" name="entries-acts"> <button class="btn btn-success" type="submit" name="create-test-entry">Create Test Entry</button> <?php if ($authenticated === false) { ?> <button class="btn btn-info" type="submit" name="login">Login and Sweep</button> <?php } ?>
public function remove_media($id_playlist = "", $id_media = "") { if ($id_playlist != "" and $id_media != "") { $list = $this->playlist->get_detail($id_playlist); if ($list) { $list = explode(",", json_decode($list->list)->id); foreach (array_keys($list, $id_media) as $key) { unset($list[$key]); } $new_list = json_encode(["id" => implode(",", $list)]); $new_data = ["list" => $new_list]; if ($this->playlist->proses_dbase("update", $this->security->xss_clean($new_data), ["id" => $id_playlist])) { flash_msg('success', '<b>Success!</b> Playlist data has been updated.'); } } redirect("playlist/detail/" . $id_playlist); } else { redirect("playlist/detail/" . $id_playlist); } }