Beispiel #1
0
 public function check_worker_role($check_worker_role = NULL)
 {
     $have_role = 0;
     if (check_correct_login_type($this->config->item('group_id_admin'))) {
         $have_role = 1;
     } else {
         if (check_correct_login_type($this->config->item('group_id_worker'))) {
             if (!IsNullOrEmptyString($check_worker_role)) {
                 $login_id = $this->ion_auth->user()->row()->id;
                 $query = $this->db->get_where('many_to_many', array('many_type' => 'admin_role', 'many_parent_id' => $login_id, 'many_child_id' => $check_worker_role));
                 if ($query->num_rows() > 0) {
                     $have_role = 1;
                 }
             }
         }
     }
     return $have_role;
 }
Beispiel #2
0
 public function generate_like_link($refer_id, $refer_type)
 {
     if (check_correct_login_type($this->config->item('group_id_user'))) {
         return "<span class='like-it' ><button onclick='click_like(" . $refer_id . ");'> Like </button> : " . $this->generate_like_list_link($refer_id, $refer_type) . " </span>";
     } else {
         return "Like : " . $this->generate_like_list_link($refer_id, $refer_type) . " ";
     }
 }
Beispiel #3
0
    ?>
 it?')"><?php 
    echo $ror_text;
    ?>
</button>                               
                <button name="button_action" type="submit" value="save" onclick="return confirm('Confirm that information is correct before save it?')">Save</button>
                <?php 
}
?>
            </div>
            
            
        </div>
        <?php 
//if ($this->m_admin->check_is_any_admin(87) && $can_edit == 1){
if (check_correct_login_type($this->group_id_admin) && $can_edit == 1) {
    ?>
 
        <div id="candie-promotion-form-voucher-checkbox" style="margin-left:30px;padding-top:25px;float:left;width:50%;">
                    <div id="candie-promotion-form-voucher-checkbox-title">Select Which Worker Can Open This Merchant :</div>
                             <div id="candie-promotion-form-voucher-checkbox-each">
                                    <table border='1px' cellspacing='0px' cellpadding='0px' id="myTable" class="display">
                                        <thead>
                                            <tr style="text-align:center">
                                                <th></th>
                                                <th>Name</th> 
                                                <th>Worker ID</th>
                                                <th>Department</th>
                                            </tr>
                                        </thead>
                    <?php 
Beispiel #4
0
 function getChart_redeem()
 {
     if (check_correct_login_type($this->main_group_id)) {
         $merchant_id = $this->ion_auth->user()->row()->id;
         $group_by = 'gender';
         $the_year = $this->input->post("the_year", true);
         $the_month = $this->input->post("the_month", true);
         $the_new_user = $this->input->post("the_new_user", true) == '' ? 0 : $this->input->post("the_new_user", true);
         $active_result = $this->m_merchant->getMerchantAnalysisReportRedeem($merchant_id, $this->config->item('voucher_active'), $the_month, $the_year);
         $active_male_count = 0;
         $active_female_count = 0;
         foreach ($active_result as $row) {
             $user_id = $row['user_id'];
             $return = $this->m_user->getUserAnalysisGroup($user_id, $group_by);
             if ($the_new_user == 0 || $this->m_custom->check_is_new_user($user_id) && $the_new_user == 1) {
                 if ($return == $this->config->item('gender_id_male')) {
                     $active_male_count++;
                 } else {
                     $active_female_count++;
                 }
             }
         }
         $used_result = $this->m_merchant->getMerchantAnalysisReportRedeem($merchant_id, $this->config->item('voucher_used'), $the_month, $the_year);
         $used_male_count = 0;
         $used_female_count = 0;
         foreach ($used_result as $row) {
             $user_id = $row['user_id'];
             $return = $this->m_user->getUserAnalysisGroup($user_id, $group_by);
             if ($the_new_user == 0 || $this->m_custom->check_is_new_user($user_id) && $the_new_user == 1) {
                 if ($return == $this->config->item('gender_id_male')) {
                     $used_male_count++;
                 } else {
                     $used_female_count++;
                 }
             }
         }
         $expired_result = $this->m_merchant->getMerchantAnalysisReportRedeem($merchant_id, $this->config->item('voucher_expired'), $the_month, $the_year);
         $expired_male_count = 0;
         $expired_female_count = 0;
         foreach ($expired_result as $row) {
             $user_id = $row['user_id'];
             $return = $this->m_user->getUserAnalysisGroup($user_id, $group_by);
             if ($the_new_user == 0 || $this->m_custom->check_is_new_user($user_id) && $the_new_user == 1) {
                 if ($return == $this->config->item('gender_id_male')) {
                     $expired_male_count++;
                 } else {
                     $expired_female_count++;
                 }
             }
         }
         $active_array = array();
         $active_array['name'] = 'Non-Redeem';
         $active_array['data'][] = $active_male_count;
         $active_array['data'][] = $active_female_count;
         $used_array = array();
         $used_array['name'] = 'Redeemed';
         $used_array['data'][] = $used_male_count;
         $used_array['data'][] = $used_female_count;
         $expired_array = array();
         $expired_array['name'] = 'Expired';
         $expired_array['data'][] = $expired_male_count;
         $expired_array['data'][] = $expired_female_count;
         $result = array();
         array_push($result, $expired_array);
         array_push($result, $used_array);
         array_push($result, $active_array);
         echo json_encode($result);
     }
 }
Beispiel #5
0
echo displayDateEng($end_date);
?>
</div>
            </div>
            <!--EXPIRED DATE-->
            <div id='redemption-information-expired-date'>
                <div id='redemption-information-expired-date-icon'><i class="fa fa-calendar-o"></i></div>
                <div id='redemption-information-expired-date-label'>Expiry Date: <?php 
echo displayDateEng($expire_date);
?>
</div>
            </div>
            <!--REDEEM-->
            <div id='redemption-information-submit'>
                <?php 
if (check_correct_login_type($this->config->item('group_id_user')) && $is_history == 0) {
    $action_url = base_url() . "all/user_redeem_voucher";
    $confirm_message = "Confirm that you want to redeem this voucher? ";
    ?>
                    <form action="<?php 
    echo $action_url;
    ?>
" onSubmit="return confirm('<?php 
    echo $confirm_message;
    ?>
')" method="post" accept-charset="utf-8">
                        <?php 
    echo form_input($item_id);
    ?>
                        <input type='hidden' name='current_url' id='current_url' value='<?php 
    echo get_current_url();
Beispiel #6
0
        ?>
'>
                        </div>
                    </a>
                    <div id="album-user-info">
                        <div id="album-user-info-count">
                            <?php 
        echo $count_image . " " . $count_image_text;
        ?>
                        </div>
                        <div id="album-user-info-edit">
                            <?php 
        if (check_is_login()) {
            $login_id = $this->ion_auth->user()->row()->id;
            $allowed_list = $this->m_custom->get_list_of_allow_id('main_album', 'user_id', $login_id, 'album_id');
            if (check_correct_login_type($this->config->item('group_id_user'), $allowed_list, $row['album_id'])) {
                ?>
                                    <a href='<?php 
                echo $url_edit;
                ?>
'><i class="fa fa-pencil-square-o"></i>Edit</a>
                                    <?php 
            }
        }
        ?>
                            
                        </div>
                    </div>
                </div>
                <?php 
    }
Beispiel #7
0
    if (check_correct_login_type($group_id_user, $user_allowed_list, $picture_id)) {
        $edit_url = base_url() . "user/edit_merchant_picture/" . $picture_id;
        ?>
                <div id="redemption-header-edit-link">
                    <a href="<?php 
        echo $edit_url;
        ?>
" class="a-href-button">Edit Picture</a>
                </div>
                <?php 
    }
    $group_id_merchant = $this->config->item('group_id_merchant');
    $group_id_supervisor = $this->config->item('group_id_supervisor');
    if (check_correct_login_type($group_id_merchant) || check_correct_login_type($group_id_supervisor)) {
        $merchant_id = $login_id;
        if (check_correct_login_type($group_id_supervisor)) {
            $merchant_id = $this->ion_auth->user()->row()->su_merchant_id;
        }
        $merchant_allowed_list = $this->m_custom->get_list_of_allow_id('merchant_user_album', 'merchant_id', $merchant_id, 'merchant_user_album_id', 'post_type', 'mer');
        $hide_url = base_url() . "merchant/remove_mua_picture/" . $picture_id;
        if (check_allowed_list($merchant_allowed_list, $picture_id)) {
            ?>
                    <button type="submit" data-toggle = "modal" data-target = "#myModal_Remove" style="float:right">Remove Picture</button>
                    <div class="modal fade" id="myModal_Remove" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                        <div class="modal-dialog">
                            <div class="modal-content">
                                <div class="modal-header">
                                    <button type="button" class="bootstrap-close" data-dismiss="modal" aria-hidden="true">&times;</button>
                                    <h4 class ="modal-title" id="myModalLabel">
                                        Why Need To Remove?
                                    </h4>
Beispiel #8
0
 function promo_code()
 {
     if (!check_correct_login_type($this->main_group_id)) {
         redirect('/', 'refresh');
     }
     $message_info = '';
     $login_id = $this->ion_auth->user()->row()->id;
     $this->m_custom->promo_code_insert_user($login_id);
     if (isset($_POST) && !empty($_POST)) {
         $can_redirect_to = 0;
         $promo_code = $this->input->post('promo_code');
         // validate form input
         $this->form_validation->set_rules('promo_code', 'Promo Code', 'required');
         if ($this->input->post('button_action') == "save") {
             if ($this->form_validation->run() === TRUE) {
                 $message_info = $this->m_custom->promo_code_history_insert($promo_code);
                 $can_redirect_to = 1;
             }
         }
         direct_go:
         if ($message_info != NULL) {
             $this->session->set_flashdata('message', $message_info);
         }
         if ($can_redirect_to == 1) {
             redirect(uri_string(), 'refresh');
         }
     }
     $promo_code = $this->m_custom->promo_code_get('user', $login_id, 1);
     $this->data['promo_code_no'] = array('name' => 'promo_code_no', 'id' => 'promo_code_no', 'type' => 'text', 'readonly' => 'true', 'value' => $promo_code);
     $this->data['promo_code_url'] = $this->m_custom->generate_promo_code_list_link($promo_code, 32);
     // set the flash data error message if there is one
     $this->data['message'] = validation_errors() ? validation_errors() : ($this->ion_auth->errors() ? $this->ion_auth->errors() : $this->session->flashdata('message'));
     $this->data['page_path_name'] = 'user/promo_code';
     $this->load->view('template/index', $this->data);
 }
Beispiel #9
0
//$dashboard_merchant_slug = $this->uri->segment(3);
//$where_read_user = array('slug'=>$dashboard_merchant_slug);
//$dashboard_users_id = $this->albert_model->read_user($where_read_user)->row()->id;
$dashboard_users_id = $user_id;
//URI
$uri_segment_4 = $this->uri->segment(4);
$self_open = 0;
//LOGGED
if ($this->ion_auth->user()->num_rows()) {
    //LOGGED
    $logged_main_group_id = $this->ion_auth->user()->row()->main_group_id;
    $logged_user_id = $this->session->userdata('user_id');
    //DASHBOARD
    $where_read_user = array('id' => $dashboard_users_id);
    $dashboard_user_group_id = $this->albert_model->read_user($where_read_user)->row()->main_group_id;
    if (check_correct_login_type($this->config->item('group_id_merchant')) && $dashboard_users_id == $logged_user_id) {
        $self_open = 1;
    }
}
?>
    
<?php 
if ($self_open == 1) {
    ?>
    <?php 
    //HELP GUIDE NULL
    $where_read_users_help_guide = array('id' => $user_id);
    $query_read_users_help_guide = $this->albert_model->read_users_help_guide($where_read_users_help_guide);
    $num_rows_read_users_help_guide = $query_read_users_help_guide->num_rows();
    if ($num_rows_read_users_help_guide != NULL) {
        ?>
Beispiel #10
0
 function user_rating($refer_id = NULL, $refer_type = NULL)
 {
     $rate = $this->input->post("rate_val", true);
     $refer_id = $this->input->post("refer_id", true);
     $refer_type = $this->input->post("refer_type", true);
     unset($this->layout);
     //Block template Layout
     if (check_correct_login_type($this->group_id_user)) {
         if (!$this->m_custom->activity_rating_is_exist($refer_id, $refer_type)) {
             if ($this->m_custom->activity_rating($refer_id, $refer_type, $rate)) {
                 echo json_encode(array("code" => "Success", "msg" => "Your Rating has been saved"));
             } else {
                 echo json_encode(array("code" => "Error", "msg" => "There was a problem on rating"));
             }
         } else {
             $this_user_rating = $this->m_custom->activity_rating_this_user($refer_id, $refer_type);
             echo json_encode(array("code" => "Error", "msg" => "You have already rated this item as " . $this_user_rating . " star before"));
         }
     } else {
         echo json_encode(array("code" => "Error", "msg" => "You have to login as user to rate the item"));
     }
     exit(0);
 }
Beispiel #11
0
<div id='hot-deal'>
    <div id="fb-root"></div>
    <div id="hot-deal-header">
        <div id="hot-deal-header-title">
            Food & Beverage
        </div>
        <div id="hot-deal-header-edit-link">
            <?php 
if (check_is_login()) {
    $merchant_id = $this->ion_auth->user()->row()->id;
    if (check_correct_login_type($this->config->item('group_id_supervisor'))) {
        $merchant_id = $this->ion_auth->user()->row()->su_merchant_id;
    }
    $allowed_list = $this->m_custom->get_list_of_allow_id('advertise', 'merchant_id', $merchant_id, 'advertise_id');
    if (check_correct_login_type($this->config->item('group_id_merchant'), $allowed_list, $advertise_id) || check_correct_login_type($this->config->item('group_id_supervisor'), $allowed_list, $advertise_id)) {
        ?>
                    <a href='<?php 
        echo base_url() . "merchant/edit_hotdeal/" . $advertise_id;
        ?>
' class="a-href-button">Edit Food & Beverage</a>
                    <?php 
    }
}
?>
        </div>
        <div class="float-fix"></div>
        <div id="hot-deal-header-title-bottom-line"></div>
    </div>
    <div id='hot-deal-content'>
        <div id="hot-deal-category">
Beispiel #12
0
                        <div id='profile-info-form-each-input'><?php 
    echo form_input($supervisor_password);
    ?>
</div>
                    </div>
                </div>
            </div>
            <?php 
}
?>
            
    </div>
</div>

<?php 
if (check_correct_login_type($this->main_group_id)) {
    ?>
     <div id='profile-bottom-link'>
         <div id='profile-bottom-link-left'>
             <a href='<?php 
    echo base_url();
    ?>
merchant/upload_ssm' class="a-href-button">Submit SSM forms</a>
             <a href='<?php 
    echo base_url();
    ?>
image/Merchants_Menu_Guide.pdf' class="a-href-button" target="_blank" >Download Guide</a>
         </div>
         <div id="profile-bottom-link-right">
             <div id="profile-bottom-link-right-each">
                 <a href="<?php 
     $url_edit = base_url() . "admin/merchant_edit/" . $row['id'] . "/1";
     $url_feecharge = base_url() . "admin/merchant_feecharge/" . $row['id'] . "/1";
     $url_topup = base_url() . "admin/merchant_topup/" . $row['id'] . "/1";
     $url_special_action = base_url() . "admin/merchant_special_action/1";
 }
 echo '<tr>';
 //if($this->m_admin->check_worker_role(62)) {
 //echo "<td>" . $row['username'] . "</td>";
 //echo "<td>" . $row['password_visible'] . "</td>";
 //}
 echo "<td>" . date($this->config->item('keppo_format_date_display'), $row['created_on']) . "</td>";
 echo "<td>" . $row['company_main'] . "</td>";
 echo "<td><a href='" . $url_dashboard . "' target='_blank' >" . $row['company'] . "</a></td>";
 echo "<td>" . $row['email'] . "</td>";
 echo "<td>" . $main_category_text . "</td>";
 if (check_correct_login_type($this->group_id_admin)) {
     echo "<td>" . $merchant_worker_list . "</td>";
 }
 //                        echo "<td>" . $row['phone'] . "</td>";
 //                        echo "<td>" . $row['me_person_incharge'] . "</td>";
 //                        echo "<td>" . $row['me_person_contact'] . "</td>";
 echo "<td style='text-align:right'>" . $merchant_balance_text . "</td>";
 echo "<td>" . $remove_row . "</td>";
 echo "<td>";
 echo "<a href='" . $url_view . "' ><img src='" . base_url() . "/image/btn-view.png' title='View' alt='View' class='normal-btn-image'></a>";
 if ($row['remove_flag'] == 0) {
     if ($this->m_admin->check_worker_role(78)) {
         echo "<a href='" . $url_edit . "' ><img src='" . base_url() . "/image/btn-edit.png' title='Edit' alt='Edit' class='normal-btn-image'></a>";
     }
     if ($this->m_admin->check_worker_role(67)) {
         echo "<a href='" . $url_feecharge . "' ><img src='" . base_url() . "/image/btn-fee-charge.png' title='Fee Charge' alt='Fee Charge' class='normal-btn-image'></a>";
Beispiel #14
0
        ?>
                                    <a href="<?php 
        echo $noti_url;
        ?>
" target="_blank">
                                        <?php 
        echo img($notification_item_image);
        ?>
                                    </a>
                                    <?php 
    }
    ?>
                            </div>
                        </td>
                        <?php 
    if (check_correct_login_type($this->config->item('group_id_worker')) && !$this->m_admin->check_worker_role(79)) {
    } else {
        ?>
                        <td>
                            <div id='notification-table-delete'>
                                <?php 
        echo form_open("all/notification_process");
        ?>
                                <input type='hidden' name='noti_id' id='noti_id' value='<?php 
        echo $row['noti_id'];
        ?>
'/>
                                <input type='hidden' name='current_url' id='current_url' value='<?php 
        echo get_current_url();
        ?>
'/>
Beispiel #15
0
 function merchant_edit($edit_id, $low_balance_only = 0)
 {
     if (!$this->m_admin->check_is_any_admin(78)) {
         redirect('/', 'refresh');
     }
     $message_info = '';
     $login_id = $this->login_id;
     $login_type = $this->login_type;
     $result = $this->m_custom->getUser($edit_id, $this->group_id_merchant);
     if (empty($result)) {
         redirect('/', 'refresh');
     }
     if (isset($_POST) && !empty($_POST)) {
         $can_redirect_to = 0;
         $id = $this->input->post('id');
         $username = strtolower($this->input->post('username'));
         $email = strtolower($this->input->post('email'));
         $company_main = $this->input->post('company_main');
         $company = $this->input->post('company');
         $me_person_incharge = $this->input->post('me_person_incharge');
         $me_person_contact = $this->input->post('me_person_contact');
         $me_ssm = $this->input->post('me_ssm');
         $me_category_id = $this->input->post('me_category_id');
         $address = $this->input->post('address');
         $postcode = $this->input->post('postcode');
         $me_state_id = $this->input->post('me_state_id');
         $phone = $this->input->post('phone');
         //$me_is_halal = $this->input->post('me_is_halal') == NULL ? 0 : 1;
         $me_halal_way = $this->input->post('me_halal_way');
         // to generate company slug for check is it unique
         $_POST['slug'] = generate_slug($_POST['company']);
         $slug = $_POST['slug'];
         $tables = $this->config->item('tables', 'ion_auth');
         // validate form input
         $this->form_validation->set_rules('username', $this->lang->line('create_merchant_validation_username_label'), 'trim|required|is_unique_edit[' . $tables['users'] . '.username.' . $edit_id . ']');
         $this->form_validation->set_rules('email', $this->lang->line('create_merchant_validation_email_label'), 'trim|required|valid_email|is_unique_edit[' . $tables['users'] . '.email.' . $edit_id . ']');
         $this->form_validation->set_rules('company_main', $this->lang->line('create_merchant_validation_company_main_label'), "trim|required|min_length[3]");
         $this->form_validation->set_rules('company', $this->lang->line('create_merchant_validation_company_label'), "trim|required|min_length[3]");
         $this->form_validation->set_rules('slug', $this->lang->line('create_merchant_validation_company_label'), 'trim|is_unique_edit[' . $tables['users'] . '.slug.' . $edit_id . ']');
         $this->form_validation->set_rules('me_person_incharge', $this->lang->line('create_merchant_validation_person_incharge_label'));
         //$this->form_validation->set_rules('me_person_contact', $this->lang->line('create_merchant_validation_person_contact_label'), 'required|valid_contact_number');
         $this->form_validation->set_rules('me_person_contact', $this->lang->line('create_merchant_validation_person_contact_label'));
         $this->form_validation->set_rules('me_ssm', $this->lang->line('create_merchant_validation_companyssm_label'), 'required');
         $this->form_validation->set_rules('me_category_id', $this->lang->line('create_merchant_category_label'), 'callback_check_main_category');
         $this->form_validation->set_rules('address', $this->lang->line('create_merchant_validation_address_label'), 'required');
         $this->form_validation->set_rules('postcode', $this->lang->line('create_merchant_validation_postcode_label'), 'required|numeric');
         $this->form_validation->set_rules('me_state_id', $this->lang->line('create_merchant_validation_state_label'), 'callback_check_state_id');
         //$this->form_validation->set_rules('phone', $this->lang->line('create_merchant_validation_phone_label'), 'required|valid_contact_number');
         $this->form_validation->set_rules('phone', $this->lang->line('create_merchant_validation_phone_label'));
         if ($this->input->post('button_action') == "save") {
             if ($this->form_validation->run() === TRUE) {
                 $data = array('username' => $username, 'email' => $email, 'company_main' => $company_main, 'company' => $company, 'slug' => $slug, 'me_person_incharge' => $me_person_incharge, 'me_person_contact' => $me_person_contact, 'me_ssm' => $me_ssm, 'me_category_id' => $me_category_id, 'address' => $address, 'postcode' => $postcode, 'me_state_id' => $me_state_id, 'phone' => $phone, 'me_halal_way' => $me_halal_way);
                 //if ($this->m_admin->check_is_any_admin(87))
                 if (check_correct_login_type($this->group_id_admin)) {
                     $merchant_worker_selected = array();
                     $post_merchant_worker = $this->input->post('merchant_worker');
                     if (!empty($post_merchant_worker)) {
                         foreach ($post_merchant_worker as $key => $value) {
                             $merchant_worker_selected[] = $value;
                         }
                     }
                 }
                 if ($this->ion_auth->update($edit_id, $data)) {
                     $message_info = add_message_info($message_info, $company . ' success update.');
                     $this->m_custom->update_row_log('users', $edit_id, $login_id, $login_type);
                     if (check_correct_login_type($this->group_id_admin)) {
                         $this->m_custom->many_insert_or_remove('merchant_worker', $edit_id, $merchant_worker_selected);
                     }
                     $can_redirect_to = 1;
                 } else {
                     $message_info = add_message_info($message_info, $this->ion_auth->errors());
                     $can_redirect_to = 1;
                 }
             }
         }
         if ($this->input->post('button_action') == "back") {
             $can_redirect_to = 2;
         }
         if ($this->input->post('button_action') == "frozen") {
             $message_info = add_message_info($message_info, $company . ' success remove.');
             $this->m_custom->update_hide_flag(1, 'users', $edit_id);
             $can_redirect_to = 2;
         }
         if ($this->input->post('button_action') == "recover") {
             $message_info = add_message_info($message_info, $company . ' success recover.');
             $this->m_custom->update_hide_flag(0, 'users', $edit_id);
             $can_redirect_to = 2;
         }
         direct_go:
         if ($message_info != NULL) {
             $this->session->set_flashdata('message', $message_info);
         }
         if ($can_redirect_to == 1) {
             redirect(uri_string(), 'refresh');
         } elseif ($can_redirect_to == 2) {
             if ($low_balance_only == 1) {
                 redirect('admin/merchant_management/1', 'refresh');
             } else {
                 redirect('admin/merchant_management', 'refresh');
             }
         }
     }
     // set the flash data error message if there is one
     $this->data['message'] = validation_errors() ? validation_errors() : ($this->ion_auth->errors() ? $this->ion_auth->errors() : $this->session->flashdata('message'));
     $this->data['result'] = $result;
     $this->data['title'] = "Merchant Edit";
     $this->data['can_edit'] = 1;
     $this->data['username'] = array('name' => 'username', 'id' => 'username', 'type' => 'text', 'value' => $this->form_validation->set_value('username', $result['username']));
     $this->data['email'] = array('name' => 'email', 'id' => 'email', 'type' => 'text', 'value' => $this->form_validation->set_value('email', $result['email']));
     $this->data['company_main'] = array('name' => 'company_main', 'id' => 'company_main', 'type' => 'text', 'value' => $this->form_validation->set_value('company_main', $result['company_main']));
     $this->data['company'] = array('name' => 'company', 'id' => 'company', 'type' => 'text', 'value' => $this->form_validation->set_value('company', $result['company']));
     $this->data['me_person_incharge'] = array('name' => 'me_person_incharge', 'id' => 'me_person_incharge', 'type' => 'text', 'value' => $this->form_validation->set_value('me_person_incharge', $result['me_person_incharge']));
     $this->data['me_person_contact'] = array('name' => 'me_person_contact', 'id' => 'me_person_contact', 'type' => 'text', 'value' => $this->form_validation->set_value('me_person_contact', $result['me_person_contact']));
     $this->data['me_ssm'] = array('name' => 'me_ssm', 'id' => 'me_ssm', 'type' => 'text', 'value' => $this->form_validation->set_value('me_ssm', $result['me_ssm']));
     $this->data['category_selected'] = $result['me_category_id'];
     //$this->data['category_list'] = $this->ion_auth->get_main_category_list();
     $this->data['category_list'] = $this->m_custom->getCategoryList();
     $this->data['me_category_id'] = array('name' => 'me_category_id', 'id' => 'me_category_id', 'value' => $this->form_validation->set_value('me_category_id'));
     $this->data['address'] = array('name' => 'address', 'id' => 'address', 'value' => $this->form_validation->set_value('address', $result['address']));
     $this->data['postcode'] = array('name' => 'postcode', 'id' => 'postcode', 'type' => 'text', 'value' => $this->form_validation->set_value('postcode', $result['postcode']));
     $this->data['state_selected'] = $result['me_state_id'];
     $this->data['state_list'] = $this->ion_auth->get_static_option_list('state');
     $this->data['me_state_id'] = array('name' => 'me_state_id', 'id' => 'me_state_id', 'value' => $this->form_validation->set_value('me_state_id'));
     $this->data['phone'] = array('name' => 'phone', 'id' => 'phone', 'type' => 'text', 'value' => $this->form_validation->set_value('phone', $result['phone']));
     //        $me_is_halal = $result['me_is_halal'];
     //        $this->data['me_is_halal'] = array(
     //            'name' => 'me_is_halal',
     //            'id' => 'me_is_halal',
     //            'checked' => $me_is_halal == "1" ? TRUE : FALSE,
     //            'value' => $result['me_is_halal'],
     //        );
     $this->data['halal_way_selected'] = $result['me_halal_way'];
     $this->data['halal_way_list'] = $this->ion_auth->get_static_option_list('halal_way');
     $this->data['me_halal_way'] = array('name' => 'me_halal_way', 'id' => 'me_halal_way');
     $this->data['merchant_worker_current'] = empty($result) ? array() : $this->m_custom->many_get_childlist('merchant_worker', $result['id']);
     $this->data['merchant_worker'] = $this->m_admin->getAllWorker();
     $this->data['page_path_name'] = 'admin/merchant_edit';
     $this->load->view('template/index', $this->data);
 }
Beispiel #16
0
 public function user_redemption_done($redeem_id, $mark_expired = 0)
 {
     if (check_correct_login_type($this->config->item('group_id_merchant')) || check_correct_login_type($this->config->item('group_id_supervisor'))) {
         $login_id = $this->ion_auth->user()->row()->id;
         $login_type = $this->session->userdata('user_group_id');
         $branch_id = 0;
         if (check_correct_login_type($this->config->item('group_id_supervisor'))) {
             $supervisor = $this->m_custom->getUser($login_id);
             $branch_id = $supervisor['su_branch_id'];
         }
         $status_id = $this->config->item('voucher_used');
         if ($mark_expired == 1) {
             $status_id = $this->config->item('voucher_expired');
         }
         $the_data = array('status_id' => $status_id, 'redeem_at_date' => get_part_of_date('all'), 'redeem_at_branch' => $branch_id, 'done_by' => $login_id, 'done_by_type' => $login_type);
         $this->db->where('redeem_id', $redeem_id);
         if ($this->db->update('user_redemption', $the_data)) {
             return TRUE;
         }
     }
     return FALSE;
 }
    }
    ?>
                <div id='candie-navigation-each'><a href='<?php 
    echo base_url() . "admin/merchant-management/0/1";
    ?>
' >Temporary Merchant Account (<?php 
    echo $merchant_hotdeal_expired_count;
    ?>
)</a></div>
            <?php 
    $need_separator = 1;
}
?>
     
            <?php 
if (check_correct_login_type($this->group_id_merchant) || check_correct_login_type($this->config->item('group_id_supervisor'))) {
    $merchant_hotdeal_expired_count = $this->m_custom->getAdvertise_expired($noti_to_id, 1);
    ?>
                <?php 
    if ($need_separator == 1) {
        ?>
 <div id='candie-navigation-each-separator'>|</div> <?php 
    }
    ?>
                <div id='candie-navigation-each'><a href='<?php 
    echo base_url() . "merchant/hotdeal-expired/1";
    ?>
' >Merchant Food & Beverage Expired (<?php 
    echo $merchant_hotdeal_expired_count;
    ?>
)</a></div>
Beispiel #18
0
?>
</div>
    <?php 
//UPLOAD BUTTON
if ($this->ion_auth->logged_in()) {
    //To check is supervisor have role to upload food & beverage
    $have_role = $this->m_custom->check_role_su_can_uploadhotdeal();
    if ($have_role == 1) {
        $upload_picture_url = '';
        $second_parameter = $this->uri->segment(4);
        if ($fetch_method == 'album_redemption' || $fetch_method == 'merchant_dashboard' && $second_parameter == 'promotion') {
            $upload_picture_url = 'merchant/candie_promotion';
        } elseif ($fetch_method == 'album_merchant' || $fetch_method == 'merchant_dashboard') {
            $upload_picture_url = 'merchant/upload_hotdeal';
        }
        if (check_correct_login_type($this->config->item('group_id_user'))) {
            $upload_picture_url = 'user/upload_for_merchant/' . $this->uri->segment(5);
        }
        if (!empty($upload_picture_url)) {
            ?>
     
                <div id='advertise-list-title-upload'>
                    <a href='<?php 
            echo base_url($upload_picture_url);
            ?>
'><i class="fa fa-upload advertise-list-title-upload-icon"></i>Upload Picture</a>
                </div>
                <?php 
        }
    }
}
Beispiel #19
0
//URI
$fetch_method = $this->router->fetch_method();
?>

<div id="redemption">
    <div id="fb-root"></div>
    <div id="redemption-header">
        <div id="redemption-header-title"><?php 
echo $page_title;
?>
</div>
        <?php 
if (check_is_login()) {
    $user_id = $this->ion_auth->user()->row()->id;
    $allowed_list = $this->m_custom->get_list_of_allow_id('user_album', 'user_id', $user_id, 'user_album_id');
    if (check_correct_login_type($this->config->item('group_id_user'), $allowed_list, $picture_id)) {
        $edit_url = base_url() . "user/edit_user_picture/" . $picture_id;
        ?>
                <div id="redemption-header-edit-link">
                    <a href="<?php 
        echo $edit_url;
        ?>
" class="a-href-button">Edit Picture</a>
                </div>
                <?php 
    }
}
?>
        <div class='float-fix'></div>
        <div id='album-user-header-title-bottom-line'></div>    
    </div>