public function __construct()
 {
     parent::__construct();
     $this->log("Model Mod_Eco_Member loaded.");
     $this->_config = c_get_config();
     // load models
     $this->_load_models();
 }
Exemplo n.º 2
0
 public function __construct()
 {
     parent::__construct();
     // get config and store to private var
     $this->_config = c_get_config();
     // load all my voice models
     $this->_load_models();
     $this->log("Controller Search loaded.");
 }
Exemplo n.º 3
0
 public function merge_to_ocean()
 {
     $result = array("status" => false, "message" => "");
     if (is_logged_in()) {
         $mr_id = $this->input->post('m_strm', true);
         $or_id = $this->input->post('o_strm', true);
         $logged_id = $this->get_logged_uid();
         $mr_data = $this->get_single_river($mr_id);
         $or_data = $this->get_single_river($or_id);
         if ($mr_data['status'] == true) {
             $mr = $mr_data['data'];
             #$ms_sys_id = $ms['eco_sys_id'];
             if ($or_data['status'] == true) {
                 $or = $or_data['data'];
                 #$os_sys_id = $os['eco_sys_id'];
                 if (!$this->is_already_merged($mr['id'])) {
                     if (!$this->is_already_merged($or['id'])) {
                         if (!$this->is_already_requested($logged_id, $mr['id'], $or['id'])) {
                             if (!$this->is_ready_for_ocean($logged_id, $mr['id'], $or['id'])) {
                                 $merge_request = $this->add_request_to_merge($logged_id, $mr['id'], $or['id']);
                                 if ($merge_request['status'] == true) {
                                     $config = c_get_config();
                                     $user = $this->is_valid_user($this->get_logged_uid());
                                     $other_user = $this->Mod_User->get_user($or['moderator_id']);
                                     $mr_link = "<a href='" . base_url() . $config['single_river_url'] . "/{$mr[id]}'>{$mr[question_text]}</a>";
                                     $or_link = "<a href='" . base_url() . $config['single_river_url'] . "/{$or[id]}'>{$or[question_text]}</a>";
                                     $notif_details = "{$user[name]}<br />\n                                                          Invite Request for Creating Ocean<br />\n                                                          Hi {$other_user[name]}, I would like to merge my river \n                                                          {$mr_link} with your river {$or_link} \n                                                          due to our cause and awareness message and I would like to<br /> \n                                                          <br />\n                                                          promote it mutually.<br />\n                                                          Approval required, thanks.<br />";
                                     $notif_data = array('template_id' => "6", 'user_id' => "{$or['moderator_id']}", 'from_user_id' => "{$logged_id}", 'objects' => "River:River", 'object_id' => "{$merge_request[data][id]}", 'object_location' => 'eco_merge_requests', 'visit_url' => "ecosystem/invitation", 'notif_details' => $notif_details);
                                     generate_notification($notif_data, true);
                                     $result['status'] = true;
                                     $result['message'] = "Request sent.";
                                 } else {
                                     $result['message'] = $merge_request['message'];
                                 }
                             } else {
                                 $result['message'] = "River already ready for creating ocean.";
                             }
                         } else {
                             $result['message'] = "Request already sent.";
                         }
                     } else {
                         $result['message'] = "River already merged.";
                     }
                 } else {
                     $result['message'] = "River already merged.";
                 }
             } else {
                 $result['message'] = "Invalid river.";
             }
         } else {
             $result['message'] = "Invalid your river.";
         }
     } else {
         $result['message'] = "Login first.";
     }
     return $result;
 }
 public function __construct()
 {
     parent::__construct();
     // get config and store to private var
     $this->_config = c_get_config();
     // write log
     $this->log("Model Mod_Create_River loaded.");
     // load file system model
     $this->load->model("Mod_File_System");
 }
 public function __construct()
 {
     parent::__construct();
     #$this->log("Model Mod_Voice_Checker loaded.");
     $this->_config = c_get_config();
 }
<?php

if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
$config = c_get_config();
?>

<div class="leftcont brdrnone"> 
    <span class="mainbanner">
        <img src="<?php 
echo c_get_assets_url();
?>
images/my_river.jpg" alt="My Voice" />
    </span>
    <div class="container_588 bkgrnd">
        <form  name="river_post" id="river_post" action="<?php 
echo base_url() . $config['river_create_url'];
?>
" method="post" enctype="multipart/form-data">
        <div class="voiceimgcont"> <span class="voiceimg"><img src="<?php 
echo c_get_assets_url();
?>
images/image.jpg" class="vpp" alt="" /></span> 
            <div id="file-upload-cont">
                <input id="original" name="userfile" type="file" accept="image/*" />
                <div id="my-button" class="mainbrowse">Browse</div>
            </div>    
        </div>
        <div class="starheadsev">
                              
Exemplo n.º 7
0
 public function river_to_ocean()
 {
     $result = array("status" => false, "message" => "");
     if (is_logged_in()) {
         $caller_sys_id = $this->input->post('csid', true);
         $receiver_sys_id = $this->input->post('rsid', true);
         $merged_request = $this->get_merged_request_by_cr($caller_sys_id, $receiver_sys_id);
         if ($merged_request) {
             if ($merged_request['verification_str'] == '') {
                 $caller_eco_system = $this->get_eco_system_by_user($caller_sys_id, $merged_request['requested_by']);
                 if ($caller_eco_system) {
                     $receiver_eco_system = $this->get_eco_system_by_user($receiver_sys_id, $this->get_logged_uid());
                     if ($receiver_eco_system) {
                         $sql = "SELECT * FROM eco_merge_requests WHERE (caller_eco_sys_id=? OR caller_eco_sys_id=? OR receiver_eco_sys_id=? OR receiver_eco_sys_id=?)";
                         $rsl = $this->db->query($sql, array($caller_sys_id, $receiver_sys_id, $receiver_sys_id, $caller_sys_id));
                         $rows = $rsl->result_array();
                         foreach ($rows as $mr) {
                             // delete notification
                             $this->db->where('object_id', $mr['id']);
                             $this->db->delete('user_notifications');
                         }
                         $rc_key = md5(uniqid(rand())) . md5(uniqid(rand())) . md5(uniqid(rand()));
                         $data = array("verification_str" => $rc_key);
                         $this->db->where('id', $merged_request['id']);
                         $this->db->update('eco_merge_requests', $data);
                         // delete other request to merge request table
                         $this->db->where("((caller_eco_sys_id='{$caller_sys_id}' OR caller_eco_sys_id='{$receiver_sys_id}' OR receiver_eco_sys_id='{$caller_sys_id}' OR receiver_eco_sys_id='{$receiver_sys_id}') AND verification_str='')");
                         $this->db->delete('eco_merge_requests');
                         $rec_river = $this->get_single_river($receiver_sys_id);
                         if ($rec_river['status'] == true) {
                             $config = c_get_config();
                             $notif_details = "Your request to create a Ocean is accepted successfully by the moderator of \"River " . $rec_river['data']['title'] . "\". Please follow the steps below:<br />\n                                                 1. Go to your invited river: \"River <a href='" . base_url() . $config['single_stream_url'] . '/' . $rec_river['data']['id'] . "'>" . $rec_river['data']['title'] . "</a>\"<br />\n                                                 2. Click on Create Ocean button<br />\n                                                 3. Fill the form and submit.<br />";
                             $notif_data = array('template_id' => "8", 'user_id' => "{$caller_eco_system[moderator_id]}", 'from_user_id' => "{$receiver_eco_system[moderator_id]}", 'objects' => "River:River", 'object_id' => "{$merged_request[id]}", 'object_location' => 'eco_merge_requests', 'visit_url' => "ecosystem/notification", 'notif_details' => $notif_details);
                             generate_notification($notif_data, true);
                         }
                         $result['status'] = true;
                         $result['message'] = "Request accepted.";
                     } else {
                         $result['message'] = 'Receiver invalid.';
                     }
                 } else {
                     $result['message'] = 'Caller invalid.';
                 }
             } else {
                 $result['message'] = "Request already accepted.";
             }
         } else {
             $result['message'] = "Invalid caller and receiver.";
         }
     } else {
         $result['message'] = "Login first.";
     }
     return $result;
 }