Example #1
0
 function displayLastDayTime($year = '', $month = '', $until_today = 0)
 {
     $the_date = displayLastDay($year, $month, $until_today);
     $return_date = displayDate($the_date, 0, 1);
     return $return_date . " 23:59:59";
 }
Example #2
0
<?php

$inumber1 = 10;
$inumber2 = 5;
function add($number1, $number2)
{
    echo $number1 + $number2;
}
add($inumber1, $inumber2);
function displayDate($day, $date, $year)
{
    echo '<br>' . $day . ' ' . $date . ' ' . $year;
}
displayDate('Monday', 31, 2011);
Example #3
0
 function invite_friend()
 {
     //SESSION LOGGED DATA
     $logged_main_group_id = $this->session->userdata('user_group_id');
     //CONFIG ITEM
     $group_id_user = $this->config->item('group_id_user');
     if ($logged_main_group_id == $group_id_user) {
         //LOGGED CORRECT
         $data['message'] = $this->session->flashdata('message');
         //POST SUBMIT
         if ($this->input->post()) {
             //LOGGED
             $logged_user_id = $this->session->userdata('user_id');
             $where_read_user = array('id' => $logged_user_id);
             $query_read_user = $this->albert_model->read_user($where_read_user);
             $logged_user_email = $query_read_user->row()->email;
             //INPUT POST
             $input_email = $this->input->post('email');
             //VALIDATION
             $this->form_validation->set_rules('email', 'E-mail Address', 'required|valid_email');
             if ($this->form_validation->run() == true) {
                 //VALIDATION SUCCESS
                 $current_month = date("n");
                 $current_year = date("Y");
                 //READ USER_INVITE_FRIEND
                 $where_user_invite_friend = array('user_id' => $logged_user_id, 'friend_email' => $input_email);
                 $query_user_invite_friend = $this->albert_model->read_user_invite_friend($where_user_invite_friend);
                 $num_rows_user_invite_friend = $query_user_invite_friend->num_rows();
                 if ($num_rows_user_invite_friend > 0) {
                     //DUPLICATED DATA
                     $this->session->set_flashdata('message', "You had already invited '{$input_email}'");
                 } else {
                     //QUERY CANDIE BALANCE
                     $where_candie_balance = array('user_id' => $logged_user_id, 'month_id' => $current_month, 'year' => $current_year);
                     $query_candie_balance = $this->albert_model->read_candie_balance($where_candie_balance);
                     $num_rows_candie_balance = $query_candie_balance->num_rows();
                     if ($this->invite_friend_send_email($input_email, $logged_user_email)) {
                         if ($num_rows_candie_balance > 0) {
                             //UPDATE CANDIE BALANCE
                             $where_candie_balance_invite_friend_count_increment = array('user_id' => $logged_user_id, 'month_id' => $current_month, 'year' => $current_year);
                             $this->albert_model->update_candie_balance_invite_friend_count_increment($where_candie_balance_invite_friend_count_increment);
                             if ($this->db->affected_rows() == 0) {
                                 //INSERT FAIL
                                 $this->session->set_flashdata('message', 'Update fail for candie');
                             }
                         } else {
                             $data_candie_balance = array('user_id' => $logged_user_id, 'month_id' => $current_month, 'year' => $current_year, 'month_last_date' => displayDate(displayLastDay($current_year, $current_month), 0, 1));
                             $this->albert_model->insert_candie_balance($data_candie_balance);
                             if ($this->db->affected_rows() == 0) {
                                 //INSERT FAIL
                                 $this->session->set_flashdata('message', 'Insert fail for candie');
                             }
                             $query_candie_balance = $this->albert_model->read_candie_balance($where_candie_balance);
                         }
                         //INSERT USER_INVITE_FRIEND
                         $data_user_invite_friend = array('user_id' => $logged_user_id, 'friend_email' => $input_email);
                         $this->albert_model->insert_user_invite_friend($data_user_invite_friend);
                         if ($this->db->affected_rows() == 0) {
                             //INSERT FAIL
                             $this->session->set_flashdata('message', 'Insert fail for invite friend');
                         }
                         //INSERT SUCCESS
                         $this->session->set_flashdata('message', 'Invitation email sent');
                         //GIVE USER CANDIE FOR THE FIRST 5 INVITATION MONTHLY
                         $invitation_send_current_month = $query_candie_balance->row_array();
                         $user_max_invitation_get_candie_per_month = $this->m_custom->web_setting_get('user_max_invitation_get_candie_per_month');
                         if ($invitation_send_current_month['invite_friend_count'] <= $user_max_invitation_get_candie_per_month) {
                             $this->m_user->candie_history_insert(6, $invitation_send_current_month['balance_id'], 'candie_balance', 1);
                         }
                     }
                 }
                 redirect('user/invite_friend', 'refresh');
             } else {
                 //VALIDATION FAIL
                 $this->session->set_flashdata('message', validation_errors());
                 redirect('user/invite_friend', 'refresh');
             }
         }
     } else {
         //LOGGED INCORRECT
         redirect('/', 'refresh');
     }
     $data['page_path_name'] = 'user/invite_friend';
     $this->load->view('template/index', $data);
 }
Example #4
0
 public function merchant_balance_update($merchant_id, $month_id = NULL, $year = NULL)
 {
     $search_date = date_for_db_search($month_id, $year);
     if (empty($month_id)) {
         $month_id = get_part_of_date('month');
     }
     if (empty($year)) {
         $year = get_part_of_date('year');
     }
     $history_condition = "trans_time like '%" . $search_date . "%'";
     $history_search_data = array('merchant_id' => $merchant_id);
     $this->db->where($history_condition);
     $history_query = $this->db->get_where('transaction_history', $history_search_data);
     $history_result = $history_query->result_array();
     if ($history_query->num_rows() != 0) {
         $monthly_balance = 0;
         foreach ($history_result as $history_row) {
             $monthly_balance = $monthly_balance + $history_row['amount_plus'] - $history_row['amount_minus'];
         }
         $balance_search_data = array('merchant_id' => $merchant_id, 'month_id' => $month_id, 'year' => $year);
         $balance_query = $this->db->get_where('merchant_balance', $balance_search_data);
         if ($balance_query->num_rows() == 0) {
             $insert_data = array('merchant_id' => $merchant_id, 'balance' => $monthly_balance, 'month_id' => $month_id, 'year' => $year, 'month_last_date' => displayDate(displayLastDay($year, $month_id), 0, 1));
             $this->db->insert('merchant_balance', $insert_data);
         } else {
             $balance_result = $balance_query->row_array();
             $update_data = array('balance' => $monthly_balance);
             $this->db->where('balance_id', $balance_result['balance_id']);
             $this->db->update('merchant_balance', $update_data);
         }
     }
 }
Example #5
0
function showNewsId($news, $db)
{
    foreach ($news as $i => $row) {
        if ($i > 0) {
            //if repeating news (because of tags)
            echo " <a href=\"./?tag=" . $row['tagname'] . "\">#" . $row['tagname'] . "</a>";
        } else {
            echo "<div class=\"noticia\" id=" . $row['id'] . ">";
            if (loggedIn()) {
                //favorites
                if (hasFavorite($row['id'], $db)) {
                    echo "<div class=\"del_favorite\" id=\"" . $row['id'] . "\"><img width=\"30px\" src=\"common/star_filled.png\">";
                } else {
                    echo "<div class=\"add_favorite\" id=\"" . $row['id'] . "\"><img width=\"30px\" src=\"common/star_empty.png\">";
                }
                echo "</div>";
            }
            echo "<h3>" . stripslashes($row['title']) . "</h3>\n\t\t\t\t<img src=\"http://lorempixel.com/300/200/\" alt=\"300x200\">\t\t\t\t\n\t\t\t\t<div class=\"newsbody\">" . nl2br(stripslashes($row['text'])) . "</div>\n\t\t\t\t<div class=\"newsdetails\">\n\t\t\t\t<br />";
            if (!empty($row['url'])) {
                //display URL if news is imported
                echo "<b>URL original:</b> <a target=\"_blank\" href=\"" . stripslashes($row['url']) . "\">" . $row['url'] . "</a><br>";
            }
            echo "<b>Submetida por:</b> " . getUserProfileLink($row['posted_by'], $db) . "<br>";
            if (!empty($row['imported_by'])) {
                echo "<b>Importada por:</b> " . getUserProfileLink($row['imported_by'], $db) . "<br>";
            }
            echo displayDate($row['date']);
            if ($row['tagname'] != "") {
                echo "</div><div class=\"newstags\"><a href=\"./?tag=" . stripslashes($row['tagname']) . "\">#" . stripslashes($row['tagname']) . "</a>";
            }
            //first tag (close news details and start tags div)
        }
        if (++$i == sizeof($news)) {
            //if next row is the end
            echo "</div>";
            echo "<div class=comment" . $row['id'] . "><h2>Comentários:</h2><div id=comments_server></div>";
            echo "</div>";
            if (isset($_SESSION['user_id'])) {
                echo "<div id=new_comment><textarea id=textarea_new_comment rows=4 placeholder=\"Novo Comentário...\"/></textarea><br><input id=send_comment type=button value=\"Enviar Comentário\"></div>";
            }
            if (loggedIn() && (editor() || admin())) {
                echo "<ul>";
                echo "<li><a href=./>Ver Todas</a></li>";
                if (loggedIn() && (admin() || editor() && ($_SESSION['username'] == $row['posted_by'] || $_SESSION['username'] == $row['imported_by']))) {
                    echo "<li><a href=\"editar_noticia.php?id=" . $row['id'] . "\">Editar</a></li><li><a href=\"apagar_noticia.php?id=" . $row['id'] . "\">Apagar</a></li>";
                }
                echo "<li style=\"border:0;\"></li>";
                //display full height <ul>
                echo "</ul>";
            }
            echo "</div>";
        }
    }
}
Example #6
0
 public function display_row_monitor($want_count = 0)
 {
     if ($this->ion_auth->logged_in()) {
         $login_id = $this->ion_auth->user()->row()->id;
         $login_type = $this->session->userdata('user_group_id');
         $condition = "(mon_is_public = true or (mon_is_public = false and mon_for_id = " . $login_id . "))";
         $this->db->where($condition);
         $mon_query = $this->db->get_where('monitoring', array('mon_for_type' => $login_type, 'mon_status' => 0));
         if ($want_count == 1) {
             return $mon_query->num_rows();
         }
         $mon_result = $mon_query->result_array();
         $result = array();
         foreach ($mon_result as $row) {
             $mon_hide_type = $row['mon_hide_type'];
             $hide_item_desc = "";
             $hide_item_type = "";
             $post_image = "";
             switch ($mon_hide_type) {
                 case 'com':
                     $refer_row = $this->m_custom->activity_get_one_row($row['mon_table_id']);
                     $hide_item_type = "Comment";
                     $hide_item_desc = '<table style="border:none"><col width="120"><col width="5"><col >' . '<tr><td>Content</td><td>:</td><td>' . nl2br($refer_row['comment']) . '</td></tr>' . '<tr><td>Comment At</td><td>:</td><td>' . $this->m_custom->generate_act_refer_type_link($refer_row['act_refer_id'], $refer_row['act_refer_type']) . '</td></tr>' . '<tr><td>Comment By</td><td>:</td><td>' . $this->m_custom->generate_user_link($refer_row['act_by_id']) . ' (' . $this->m_custom->display_users_groups($refer_row['act_by_type'], 'description') . ')' . '</td></tr>' . '<tr><td>Time</td><td>:</td><td>' . displayDate($refer_row['act_time'], 1) . '</td></tr>' . '</table>';
                     break;
                 case 'mua':
                     $refer_row = $this->m_custom->get_one_table_record('merchant_user_album', 'merchant_user_album_id', $row['mon_table_id'], 1);
                     $hide_item_type = "Picture Upload For Merchant";
                     $hide_item_desc = '<table style="border:none"><col width="120"><col width="5"><col >' . '<tr><td>Title</td><td>:</td><td>' . $refer_row['title'] . '</td></tr>' . '<tr><td>Description</td><td>:</td><td>' . nl2br($refer_row['description']) . '</td></tr>' . '<tr><td>Upload By</td><td>:</td><td>' . $this->m_custom->generate_user_link($refer_row['user_id']) . '</td></tr>' . '<tr><td>Post Date</td><td>:</td><td>' . displayDate($refer_row['create_date'], 1) . '</td></tr>' . '<tr><td>Removed Reason</td><td>:</td><td>' . $refer_row['hide_remark'] . '</td></tr>' . '</table>';
                     $post_image = $this->m_custom->generate_image_link($refer_row['image'], $mon_hide_type);
                     break;
                 case 'adv':
                     $refer_row = $this->m_custom->getOneAdvertise($row['mon_table_id'], 1, 1);
                     $hide_item_type = "Merchant Picture";
                     $hide_item_desc = '<table style="border:none"><col width="120"><col width="5"><col >' . '<tr><td>Title</td><td>:</td><td>' . $refer_row['title'] . '</td></tr>' . '<tr><td>Description</td><td>:</td><td>' . nl2br($refer_row['description']) . '</td></tr>' . '<tr><td>Post Date</td><td>:</td><td>' . displayDate($refer_row['create_date'], 1) . '</td></tr>' . '</table>';
                     $post_image = $this->m_custom->generate_image_link($refer_row['image'], $mon_hide_type);
                     break;
             }
             if ($refer_row != FALSE) {
                 $extra_info = array('hide_time_text' => displayDate($row['hide_time'], 1), 'hide_item_type' => $hide_item_type, 'hide_item_desc' => $hide_item_desc, 'post_image' => $post_image, 'hide_by_text' => $this->m_custom->display_users($row['hide_by'], 0, 1), 'hide_by_type_text' => $this->m_custom->display_users_groups($row['hide_by_type'], 'description'));
                 $result[] = $row + $extra_info + $refer_row;
             }
         }
         return $result;
     }
 }
Example #7
0
function getRefStatusShare($ref_id, $u_id)
{
    global $db;
    $sql = "SELECT * FROM user_status WHERE us_id=:ref_id AND u_id=:u_id LIMIT 1";
    $stmt = $db->prepare($sql);
    $stmt->bindParam(':ref_id', $ref_id, PDO::PARAM_INT);
    $stmt->bindParam(':u_id', $u_id, PDO::PARAM_INT);
    $stmt->execute();
    $obj = $stmt->fetchObject();
    $displayDate = displayDate($obj->us_date, 2);
    $obj->displayDate = $displayDate;
    return $obj;
}
Example #8
0
 function keppo_voucher_redeem_change($edit_id)
 {
     if (!$this->m_admin->check_is_any_admin(71)) {
         redirect('/', 'refresh');
     }
     $message_info = '';
     $login_id = $this->login_id;
     $login_type = $this->login_type;
     $main_table = 'user_redemption';
     $main_table_id_column = 'redeem_id';
     $result = $this->m_custom->get_one_table_record($main_table, $main_table_id_column, $edit_id, 1);
     $status_id_active = $this->config->item('voucher_active');
     $status_id_used = $this->config->item('voucher_used');
     if (empty($result)) {
         redirect('/', 'refresh');
     }
     if (isset($_POST) && !empty($_POST)) {
         $can_redirect_to = 0;
         $id = $this->input->post('id');
         $top_up_serial_code = $this->input->post('top_up_serial_code');
         $top_up_already = $this->input->post('top_up_already') == NULL ? $status_id_active : $status_id_used;
         $top_up_date = validateDate($this->input->post('top_up_date'));
         $top_up_time = $this->input->post('top_up_time') == NULL ? NULL : $this->input->post('top_up_time');
         $this->form_validation->set_rules('top_up_serial_code', 'Serial Code');
         $this->form_validation->set_rules('top_up_date', 'Top Up Date');
         $this->form_validation->set_rules('top_up_time', 'Top Up Time');
         if ($this->input->post('button_action') == "save") {
             if ($this->form_validation->run() === TRUE) {
                 $data = array('top_up_serial_code' => $top_up_serial_code, 'top_up_date' => $top_up_date, 'top_up_time' => $top_up_time);
                 if ($this->m_custom->simple_update($main_table, $data, $main_table_id_column, $id)) {
                     if ($top_up_already == $status_id_used) {
                         $this->m_admin->promotion_admin_redemption_done($id);
                     } else {
                         if ($top_up_already == $status_id_active) {
                             $this->m_admin->promotion_admin_redemption_done($id, 0, 1);
                         }
                     }
                     $message_info = add_message_info($message_info, 'Record success update.');
                     $can_redirect_to = 2;
                 } 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;
         }
         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) {
             redirect('admin/keppo_voucher_redemption_page', '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'] = "User Redemption Edit";
     $this->data['can_edit'] = 1;
     $this->data['top_up_serial_code'] = array('name' => 'top_up_serial_code', 'id' => 'top_up_serial_code', 'type' => 'text', 'value' => $result['top_up_serial_code']);
     $top_up_already_value = $result['status_id'];
     $this->data['top_up_already_value'] = $top_up_already_value;
     $this->data['top_up_already'] = array('name' => 'top_up_already', 'id' => 'top_up_already', 'checked' => $top_up_already_value == $status_id_used ? TRUE : FALSE, 'value' => $result['status_id']);
     $this->data['top_up_date'] = array('name' => 'top_up_date', 'id' => 'top_up_date', 'readonly' => 'true', 'value' => empty($result) ? '' : displayDate($result['top_up_date']));
     $this->data['top_up_time'] = array('name' => 'top_up_time', 'id' => 'top_up_time', 'value' => empty($result) ? '' : $result['top_up_time']);
     $this->data['page_path_name'] = 'admin/keppo_voucher_redeem_change';
     $this->load->view('template/index', $this->data);
 }
								}else{
								echo '<img class="img-slide-show" data-type="image" style="max-width:754px;max-height: 562px" src="' . callThumbListFrontEndByID($rowPic['PIC_ID'], $rowPic['CAT_ID'], true) . '">'."\n\t";
								$thumbRender .= '<img style="max-height: 186px;height: 186px;" src="' . callThumbListFrontEndByID($rowPic['PIC_ID'], $rowPic['CAT_ID'], true) . '">'."\n\t";
								}
								echo '</div>'."\n\t";
								$thumbRender .= '</div>'."\n\t";
								}
								?>
							</div>
							<a class="btn-arrow-slide pev"></a>
							<a class="btn-arrow-slide next"></a>
							<div class="box-title-main">

								<div class="box-date-tumb">
									<p class="date">
										<?=displayDate($eventRow['EVENT_START_DATE']) ?>
									</p>
									<p class="month">
										<?=displayShortMonth($eventRow['EVENT_START_DATE']) ?>
									</p>
								</div>
								<div class="box-text">
									<p class="text-title">
										<?=$eventRow['CONTENT_DESC'] ?>
									</p>
									<p class="text-des">
										<?=$eventRow['MUSEUM_NAME'] ?>
									</p>
								</div>
							</div>
						</div>
Example #10
0
                    <tr style="text-align:center">
                        <th>Merchant Name</th>
                        <th>Amount (RM)</th>
                        <th>Transaction Bank</th>
                        <th>Transaction Date</th>
                        <th>Transaction No</th>
                        <th>Remark</th>
                        <th>Top Up Record By Admin</th>
                        <th>Actions</th>
                    </tr>
                </thead>
                <tbody>
                    <?php 
foreach ($the_result as $row) {
    $merchant_name = $this->m_custom->display_users($row['merchant_id']);
    $topup_trans_date = displayDate($row['topup_trans_date']);
    $admin_name = $this->m_custom->display_users($row['admin_id']);
    $url_edit = base_url() . "admin/merchant_topup_edit/" . $row['merchant_id'] . "/" . $row['topup_id'];
    if ($low_balance_only == 1) {
        $url_edit = base_url() . "admin/merchant_topup_edit/" . $row['merchant_id'] . "/" . $row['topup_id'] . "/1";
    }
    echo '<tr>';
    echo "<td>" . $merchant_name . "</td>";
    echo "<td style='text-align:right'>" . $row['topup_amount'] . "</td>";
    echo "<td>" . $row['topup_bank'] . "</td>";
    echo "<td>" . $topup_trans_date . "</td>";
    echo "<td>" . $row['topup_trans_no'] . "</td>";
    echo "<td>" . $row['topup_remark'] . "</td>";
    echo "<td>" . $admin_name . "</td>";
    echo "<td>";
    echo "<a href='" . $url_edit . "' ><img src='" . base_url() . "/image/btn-edit.png' title='Edit' alt='Edit' class='normal-btn-image'></a>";
Example #11
0
                <thead>
                    <tr style="text-align:center">
                        <th>Title</th>
                        <th>Image</th>
                        <th>Start Date</th>
                        <th>End Date</th>
                        <th>Actions</th>
                    </tr>
                </thead>
                <tbody>
                    <?php 
foreach ($the_result as $row) {
    $noti_url = base_url() . 'all/advertise/' . $row['advertise_id'];
    $image_url = base_url() . $this->config->item('album_merchant') . $row['image'];
    $start_time = displayDate($row['start_time']);
    $end_time = displayDate($row['end_time']);
    $url_special_action = base_url() . "merchant/hotdeal_expired";
    echo '<tr>';
    echo "<td><a href='{$noti_url}' target='_blank'>" . $row['title'] . "</a></td>";
    echo "<td>";
    if (!empty($row['image'])) {
        echo "<img style='max-height:200px;max-width:200px' src='" . $image_url . "'>";
    }
    echo "</td>";
    echo "<td>" . $start_time . "</td>";
    echo "<td>" . $end_time . "</td>";
    echo "<td>";
    $have_role = $this->m_custom->check_role_su_can_uploadhotdeal();
    if ($have_role == 1) {
        echo form_open($url_special_action);
        echo form_hidden('id', $row['advertise_id']);
Example #12
0
 function voucher($advertise_id = NULL, $redeem_id = NULL)
 {
     if ($advertise_id == NULL || $redeem_id == NULL) {
         redirect('/', 'refresh');
     }
     if ($this->ion_auth->logged_in()) {
         $login_id = $this->ion_auth->user()->row()->id;
         $login_data = $this->m_custom->get_one_table_record('users', 'id', $login_id, 1);
     } else {
         redirect('/', 'refresh');
     }
     $the_row = $this->m_custom->getOneAdvertise($advertise_id, 0, 0, 0, 1);
     if ($the_row) {
         $advertise_type = $the_row['advertise_type'];
         if ($advertise_type != "pro" && $advertise_type != "adm" || !$this->m_user->user_redemption_check($login_id, $redeem_id) && !$this->m_merchant->merchant_redemption_check($login_id, $advertise_id)) {
             redirect('/', 'refresh');
         }
         $merchant_row = $this->m_merchant->getMerchant($the_row['merchant_id']);
         $this->data['merchant_dashboard_url'] = base_url() . "all/merchant-dashboard/" . $merchant_row['slug'] . '//' . $the_row['merchant_id'];
         $redeem_row = $this->m_custom->getOneUserRedemption($redeem_id);
         //            if (check_correct_login_type($this->group_id_user))
         //            {
         //                $this->data['user_id'] = $login_id;
         //                $this->data['user_name'] = $this->m_custom->display_users($login_id);
         //                $this->data['user_dob'] = displayDate($login_data['us_birthday']);
         //                $this->data['user_email'] = $login_data['email'];
         //                $this->data['current_candie'] = $this->m_user->candie_check_balance($login_id);
         //            }
         $this->data['advertise_type'] = $advertise_type;
         $this->data['advertise_id'] = $advertise_id;
         $this->data['merchant_name'] = $merchant_row['company'];
         $this->data['title'] = $the_row['title'];
         $this->data['description'] = $the_row['description'];
         $this->data['extra_term'] = $the_row['extra_term'];
         if ($advertise_type == "adm") {
             $this->data['image_url'] = base_url($this->album_admin . $the_row['image']);
         } else {
             $this->data['image_url'] = base_url($this->album_merchant . $the_row['image']);
         }
         $this->data['sub_category'] = $this->m_custom->display_category($the_row['sub_category_id']);
         $this->data['start_date'] = displayDate($the_row['start_time']);
         $this->data['end_date'] = displayDate($the_row['end_time']);
         $this->data['message'] = $this->session->flashdata('message');
         $this->data['voucher'] = $redeem_row['voucher'];
         $this->data['voucher_not_need'] = $the_row['voucher_not_need'];
         $this->data['voucher_worth'] = $the_row['voucher_worth'];
         $this->data['voucher_barcode'] = base_url("barcode/generate/" . $redeem_row['voucher']);
         $this->data['voucher_candie'] = $the_row['voucher_candie'];
         $this->data['expire_date'] = displayDate($the_row['voucher_expire_date']);
         $this->data['candie_term'] = $this->m_custom->many_get_childlist_detail('candie_term', $advertise_id, 'dynamic_option');
         $this->data['candie_branch'] = $this->m_custom->many_get_childlist_detail('candie_branch', $advertise_id, 'merchant_branch');
         $this->data['page_path_name'] = 'all/voucher';
         $template_used = 'template/index_background_blank';
         $this->load->library('user_agent');
         if ($this->agent->is_browser('Safari')) {
             $template_used = 'template/body';
         }
         $this->load->view($template_used, $this->data);
     } else {
         redirect('/', 'refresh');
     }
 }
        
    </div>
    <div id="float-fix"></div>
    <br/>
    <div id='payment-charge-table'>
            <table border='1px' cellspacing='0px' cellpadding='0px' id="myTable" class="display">
                <thead>
                    <tr style="text-align:center">
                        <th>Bonus Candie Amount (RM)</th> 
                        <th>Bonus Reason</th> 
                        <th>Give by Admin/Worker</th> 
                        <th>Give Time</th>
                    </tr>
                </thead>
                <tbody>
                    <?php 
foreach ($the_result as $row) {
    $admin_name = $this->m_custom->display_users($row['admin_id']);
    $trans_time = displayDate($row['trans_time'], 1);
    echo '<tr>';
    echo "<td style='text-align:right'>" . $row['amount_change'] . "</td>";
    echo "<td>" . $row['trans_remark'] . "</td>";
    echo "<td>" . $admin_name . "</td>";
    echo "<td>" . $trans_time . "</td>";
    echo '</tr>';
}
?>
                </tbody>    
            </table>
        </div>
</div>
        echo $redeem_row['voucher'];
        ?>
</a>
                                    </div>
                                </td>
                                <td>
                                    <div class="table-text-overflow-ellipsis">
                                        <?php 
        echo $redeem_row['top_up_serial_code'];
        ?>
                                    </div>
                                </td>
                                <td>
                                    <div class="table-text-overflow-ellipsis">
                                        <?php 
        echo displayDate($redeem_row['top_up_date']);
        ?>
                                    </div>
                                </td>
                                <td>
                                    <div class="table-text-overflow-ellipsis">
                                        <?php 
        echo displayTime($redeem_row['top_up_time']);
        ?>
                                    </div>
                                </td>   
                                <?php 
        if ($show_used == 0) {
            $confirm_message = "Confirm that you want to change " . $user_name . " voucher " . $redeem_row['voucher'] . " status?";
            ?>
                                    <td>
Example #15
0
                        <th>Rating</th>
                        <th>Redeemed</th>
                        <th>User Upload</th>
                        <th>Remove Already</th>
                        <th>Total</th>
                    </tr>
                </thead>
                <tbody>
                    <?php 
foreach ($the_result as $row) {
    $redeem_row = $row['redeem_count'] === NULL ? NULL : $row['redeem_count'] . " (" . money($row['redeem_amount']) . ")";
    //$userupload_row = $row['userupload_count'] === NULL ? NULL : $row['userupload_count'] . " (" . money($row['userupload_amount']) . ")";
    $userupload_row = $row['userupload_count'] === NULL ? NULL : $row['userupload_count'];
    $remove_row = $row['hide_flag'] == 1 ? 'Removed' : '';
    echo '<tr>';
    echo "<td>" . displayDate($row['create_date'], 1) . "</td>";
    echo "<td>" . $row['title_url'] . "</td>";
    echo "<td>" . $row['type_text'] . "</td>";
    //echo "<td>" . $row['view_count'] . " (" . money($row['view_amount']) . ")</td>";
    //echo "<td>" . $row['like_count'] . " (" . money($row['like_amount']) . ")</td>";
    //echo "<td>" . $row['rating_count'] . " (" . money($row['rating_amount']) . ")</td>";
    echo "<td>" . $row['view_count'] . "</td>";
    echo "<td>" . $row['like_count'] . "</td>";
    echo "<td>" . $row['rating_count'] . "</td>";
    echo "<td>" . $redeem_row . "</td>";
    echo "<td>" . $userupload_row . "</td>";
    echo "<td>" . $remove_row . "</td>";
    echo "<td>" . money($row['total_amount']) . "</td>";
    echo '</tr>';
}
?>
Example #16
0
 function analysis_report($search_month = NULL, $search_year = NULL, $search_adv_type = NULL, $search_new_user = NULL)
 {
     $message_info = '';
     if (check_correct_login_type($this->main_group_id)) {
         //$this->data['charts'] = $this->getChart($merchant_id);
         $merchant_id = $this->ion_auth->user()->row()->id;
         $merchant_data = $this->m_custom->getUser($merchant_id);
         if (isset($_POST) && !empty($_POST)) {
             if ($this->input->post('button_action') == "search_history") {
                 $search_month = $this->input->post('the_month');
                 $search_year = $this->input->post('the_year');
                 $search_adv_type = $this->input->post('the_adv_type');
                 $search_new_user = $this->input->post('the_new_user');
             }
         }
         $year_list = generate_number_option(get_part_of_date('year', $merchant_data['created_on'], 1), get_part_of_date('year'));
         $this->data['year_list'] = $year_list;
         $this->data['the_year'] = array('name' => 'the_year', 'id' => 'the_year');
         $selected_year = empty($search_year) ? get_part_of_date('year') : $search_year;
         $this->data['the_year_selected'] = $selected_year;
         $month_list = $this->m_custom->month_group_list();
         $this->data['month_list'] = $month_list;
         $this->data['the_month'] = array('name' => 'the_month', 'id' => 'the_month');
         $selected_month = empty($search_month) ? get_part_of_date('month') : $search_month;
         $this->data['the_month_selected'] = $selected_month;
         $adv_type_list = array('' => 'All Advertise', 'hot' => 'Food & Beverage', 'pro' => 'Promotion');
         $this->data['adv_type_list'] = $adv_type_list;
         $this->data['the_adv_type'] = array('name' => 'the_adv_type', 'id' => 'the_adv_type');
         $this->data['the_adv_type_selected'] = empty($search_adv_type) ? "" : $search_adv_type;
         $new_user_list = array('' => 'All User', '1' => 'New User Only');
         $this->data['new_user_list'] = $new_user_list;
         $this->data['the_new_user'] = array('name' => 'the_new_user', 'id' => 'the_new_user');
         $this->data['the_new_user_selected'] = empty($search_new_user) ? "" : $search_new_user;
         $first_day = displayDate(getFirstLastTime($selected_year, $selected_month));
         $last_day = displayDate(getFirstLastTime($selected_year, $selected_month, 1));
         $this->data['first_day'] = $first_day;
         $this->data['last_day'] = $last_day;
         $this->data['message'] = $this->session->flashdata('message');
         $this->data['page_path_name'] = 'merchant/analysis_report';
         $this->load->view('template/index', $this->data);
     } else {
         redirect('/', 'refresh');
     }
 }
Example #17
0
                        <th>Age</th>
                        <th>Gender</th>
                        <th>Birthday</th>
                        <th>Candie</th>
                        <th>Balance (RM)</th>
                        <th>Frozen Already</th>   
                        <th>Actions</th>
                        <th>Special Actions</th>
                    </tr>
                </thead>
                <tbody>
                    <?php 
foreach ($the_result as $row) {
    $race_text = $this->m_custom->display_static_option($row['us_race_id']);
    $gender_text = $this->m_custom->display_static_option($row['us_gender_id']);
    $birthday_text = displayDate($row['us_birthday']);
    $user_candie_text = $this->m_user->candie_check_balance($row['id']);
    $user_balance_text = $this->m_user->user_check_balance($row['id']);
    $remove_row = $row['remove_flag'] == 1 ? 'Hide' : ($row['hide_flag'] == 1 ? 'Frozen' : '');
    $url_view = base_url() . "admin/user_view/" . $row['id'];
    //$url_edit = base_url() . "admin/user_edit/" . $row['id'];
    $url_bonus_candie = base_url() . "admin/user_bonus_candie/" . $row['id'];
    $url_balance_adjust = base_url() . "admin/user_balance_adjust/" . $row['id'];
    $url_promo_code = base_url() . "admin/promo_code_change_user/" . $row['id'];
    $url_dashboard = base_url() . "all/user_dashboard/" . $row['id'];
    $url_special_action = base_url() . "admin/user_special_action";
    echo '<tr>';
    //                        if($this->m_admin->check_worker_role(62)) {
    //                        echo "<td>" . $row['username'] . "</td>";
    //                        echo "<td>" . $row['password_visible'] . "</td>";
    //                        }
Example #18
0
?>
		<?php 
if (empty($messages)) {
    echo "There are no messages between you and " . $user->full_name . " yet.<br><br>";
    echo "<a class=\"btn btn-success\" href=\"compose.php?to={$user_id}\">Compose a new message</a>";
}
foreach ($messages as $message) {
    $sender = new User($message->sender_id);
    $sender = $sender->user;
    $sstaf = $sender->id == 1 ? true : false;
    $self = USER_ID == $sender->id ? true : false;
    if (!$self) {
        Messages::msgSeen($message->user_id, $message->id);
    }
    $img_path = $sender->img_path;
    $date = displayDate($message->date);
    $timeAgo = get_timeAgo($message->date);
    $subject = ctrim($message->subject, 120, true);
    ?>
				<div class="message message-row ui">
					<div class="message-image">
						<?php 
    if ($sstaf) {
        ?>
							<img class="ui tiny image" src="<?php 
        echo $img_path;
        ?>
">
						<?php 
    } else {
        ?>
                    <tr style="text-align:center">
                        <th>Merchant Name</th>
                        <th>Amount (RM)</th>
                        <th>Fee Charge Type</th>
                        <th>Transaction Date</th>
                        <th>Remark</th>
                        <th>Fee Charge Record By Admin</th>
<!--                        <th>Actions</th>-->
                    </tr>
                </thead>
                <tbody>
                    <?php 
foreach ($the_result as $row) {
    $merchant_name = $this->m_custom->display_users($row['user_id']);
    $fee_charge_type = $this->m_custom->display_dynamic_option($row['refer_id']);
    $trans_date = displayDate($row['trans_time']);
    $admin_name = $this->m_custom->display_users($row['admin_id']);
    //                        $url_edit = base_url() . "admin/merchant_feecharge_edit/" . $row['user_id'] . "/" . $row['extra_id'];
    //                        if ($low_balance_only == 1)
    //                        {
    //                            $url_edit = base_url() . "admin/merchant_feecharge_edit/" . $row['user_id'] . "/" . $row['extra_id'] . "/1";
    //                        }
    echo '<tr>';
    echo "<td>" . $merchant_name . "</td>";
    echo "<td style='text-align:right'>" . $row['amount_change'] . "</td>";
    echo "<td>" . $fee_charge_type . "</td>";
    echo "<td>" . $trans_date . "</td>";
    echo "<td>" . $row['trans_remark'] . "</td>";
    echo "<td>" . $admin_name . "</td>";
    //                        echo "<td>";
    //                        echo "<a href='" . $url_edit . "' ><img src='". base_url() . "/image/btn-edit.png' title='Edit' alt='Edit' class='normal-btn-image'></a>";
Example #20
0
 </tr>
 <tr align="left">
   <td><b>NAMA KELUARAN</b></td>
   <td>' . $row['kp_product_name'] . '</td>
   <td><b>PEMEGANG</b></td>
   <td>&nbsp;</td>
 </tr>
 <tr align="left">
   <td><b>NO KUMPULAN</b></td>
   <td>' . $row['kp_batch_no'] . '</td>
   <td><b>TARIKH DITERIMA</b></td>
   <td>' . displayDate($row['kp_tkh_terima']) . '</td>
 </tr>
 <tr align="left">
   <td><b>TARIKH DIBUAT/LUPUT</b></td>
   <td>' . displayDate($row['kp_tkh_luput']) . '</td>
   <td>' . getLabel($row['kp_rsc_kod']) . '</td>
   <td>&nbsp;</td>
 </tr>
 <tr align="left">
   <td><b>NO PENDAFTARAN</b></td>
   <td>&nbsp;</td>
   <td><b>NO RUJUKAN</b></td>
   <td>&nbsp;</td>
 </tr>
 <tr align="left">
   <td><b>PENGHANTAR</b></td>
   <td></td>
   <td colspan="2">&nbsp;</td>
 </tr>
 <tr align="left">
Example #21
0
 } else {
     if ($json->{'result'} == "error") {
         echo "<h5>O servidor reportou um erro com o código " . $json->{'code'} . ": \"" . $json->{'reason'} . "\"</h5>";
     } else {
         $json_news = $json->{'data'};
         $_SESSION['json_news'][$serveri] = $json_news;
         if (count($json_news) == 0) {
             //if no results
             echo "<h5>Nenhuma notícia encontrada!</h5>";
         } else {
             echo "<form method=\"post\">";
             foreach ($json_news as $i => $row) {
                 echo "<div class=\"noticia\">\n\t\t\t\t\t\t\t\t<h3><input type=\"checkbox\" name=\"news[" . $serveri . "][" . $i . "]\"> " . strip_tags(stripslashes($row->{'title'})) . "<div class=\"arrow\">˅</div></h3>\n\t\t\t\t\t\t\t\t<div class=\"newsbody\" style=\"display:none;\">" . nl2br(strip_tags(stripslashes($row->{'text'}))) . "</div>\n\t\t\t\t\t\t\t\t<div class=\"newsdetails\">\n\t\t\t\t\t\t\t\t<br />\n\t\t\t\t\t\t\t\tURL: <a target=\"_blank\" href=\"" . strip_tags(stripslashes($row->{'url'})) . "\">" . strip_tags(stripslashes($row->{'url'})) . "</a><br>\n\t\t\t\t\t\t\t\tSubmetida por: " . strip_tags(stripslashes($row->{'posted_by'})) . "<br>";
                 //only display text and details on detailed view (one news item)
                 $date = strtotime($row->{'date'});
                 echo displayDate($date);
                 echo "<br></div>";
                 if (!empty($row->{'tags'})) {
                     echo "<div class=\"newstags\">";
                     foreach ($row->{'tags'} as $i => $json_tag) {
                         echo "#" . strip_tags(stripslashes($json_tag));
                         if (++$i != count($row->{'tags'})) {
                             echo " ";
                         }
                     }
                     echo "</div>";
                 }
                 echo "<br></div>";
             }
         }
     }
Example #22
0
function rejectList()
{
    $query = "SELECT pp_kod,pp_ref_no,pp_tkh_submit,pp_nama,rkatp_desc,rkatp_class FROM p_product\n            LEFT JOIN ref_kat_produk ON pp_rkatp_kod = rkatp_kod\n            LEFT JOIN p_product_manu ON p_product_manu.ppm_pp_kod = p_product.pp_kod AND ppm_rmr_kod=1\n            LEFT JOIN o_syarikat_add ON o_syarikat_add.osa_kod = p_product_manu.ppm_osa_kod\n            LEFT JOIN o_syarikat ON o_syarikat.os_kod = o_syarikat_add.osa_os_kod\n            WHERE pp_rs_kod IN(1102) AND rkatp_sample_applicable = 1\n            GROUP BY pp_kod";
    ?>
  <div class="tab-content pn br-n admin-form">
    <input type="hidden" id="mainTitle" value="<?php 
    echo sampleTitle(1, 2);
    ?>
">
    <div class="row">
      <table class="table table-striped table-bordered table-hover" id="primary" cellspacing="0" width="100%">
        <thead>
          <tr class="alert" align="center">
              <td width="5%">No</td>
              <td width="10%">Call No</td>
              <td width="65%">Product Name</td>
              <td width="10%">Send Date</td>
              <td width="10%">Reject Date</td>
          </tr>
        </thead>
        <tbody>
          <?php 
    $count = 1;
    $result = selQuery($query);
    while ($row = mysqli_fetch_assoc($result)) {
        ?>
          <tr align="center">
              <td><?php 
        echo $count++;
        ?>
</td>
              <td><?php 
        echo $row['pp_kod'];
        ?>
</td>
              <td align="left">
                <div class="text-primary">
                  <b><?php 
        echo $row['pp_nama'];
        ?>
</b>
                </div>
                <div class="text-muted">
                  <?php 
        echo $row['rkatp_desc'] . " - " . $row['rkatp_class'];
        ?>
                </div>
              </td>
              <td><?php 
        echo displayDate($row['pp_tkh_submit']);
        ?>
</td>
              <td><?php 
        echo getLog(1102, $row['pp_kod']);
        ?>
</td>
          </tr>
          <?php 
    }
    ?>
        </tbody>
      </table>
    </div>
      <div class="col-md-12">&nbsp;</div>
      <div class="row" align="right">
        <div class="btn-group">
          <button type="button" class="btn btn-alert dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
            Action
            <span class="caret ml5"></span>
          </button>
          <ul class="dropdown-menu" role="menu">
            <li><a style="cursor:pointer" onclick="screenList(1)">In Tray</a></li>
            <li><a style="cursor:pointer" onclick="screenList(2)">Rejected List</a></li>
          </ul>
        </div>
      </div>
  </div>
<?php 
}
Example #23
0
 public function export()
 {
     $merchant_id = Yii::app()->functions->getMerchantID();
     $db_ext = new DbExt();
     if (!empty($_SESSION['kr_export_stmt'])) {
         $stmt = $_SESSION['kr_export_stmt'];
         $pos = strpos($stmt, "LIMIT");
         $stmt = substr($stmt, 0, $pos);
         switch ($this->data['rpt']) {
             case 'sales-report':
                 if ($res = $db_ext->rst($stmt)) {
                     $csvdata = array();
                     $datas = array();
                     foreach ($res as $val) {
                         $item = '';
                         $date = date('m-d-Y G:i:s', strtotime($val['date_created']));
                         $latestdata[] = array($val['order_id'], $val['client_name'], $val['item'], $val['trans_type'], $val['payment_type'], prettyFormat($val['sub_total'], $merchant_id), prettyFormat($val['tax'], $merchant_id), prettyFormat($val['total_w_tax'], $merchant_id), $val['status'], $date);
                     }
                     unset($data);
                     $data = $latestdata;
                 }
                 if (is_array($data) && count($data) >= 1) {
                     $csvdata = array();
                     $datas = array();
                     foreach ($data as $val) {
                         foreach ($val as $key => $vals) {
                             $datas[] = $vals;
                         }
                         $csvdata[] = $datas;
                         unset($datas);
                     }
                 }
                 $header = array(Yii::t("default", "Ref#"), Yii::t("default", "Client Name"), Yii::t("default", "Item"), Yii::t("default", "Trans Type"), Yii::t("default", "Payment Type"), Yii::t("default", "Total"), Yii::t("default", "Tax"), Yii::t("default", "Total W/Tax"), Yii::t("default", "Status"), Yii::t("default", "Date"));
                 $filename = $this->data['rpt'] . '-' . date('c') . '.csv';
                 $excel = new ExcelFormat($filename);
                 $excel->addHeaders($header);
                 $excel->setData($csvdata);
                 $excel->prepareExcel();
                 exit;
                 break;
             case "sales-summary-report":
                 $has_date_range = false;
                 if (isset($_SESSION['rpt_date_range'])) {
                     if (is_array($_SESSION['rpt_date_range'])) {
                         $has_date_range = true;
                     }
                 }
                 if ($res = $db_ext->rst($stmt)) {
                     foreach ($res as $val) {
                         $total_amt = '';
                         if ($has_date_range == true) {
                             $data[] = array($val['item_id'], $val['item_name'], $val['size'], prettyFormat($val['discounted_price'], $merchant_id), prettyFormat($val['total_qty'], $merchant_id), prettyFormat($val['total_qty'] * $val['discounted_price'], $merchant_id), $_SESSION['rpt_date_range']['start_date'], $_SESSION['rpt_date_range']['end_date']);
                         } else {
                             $data[] = array($val['item_id'], $val['item_name'], $val['size'], prettyFormat($val['discounted_price'], $merchant_id), prettyFormat($val['total_qty'], $merchant_id), prettyFormat($val['total_qty'] * $val['discounted_price'], $merchant_id));
                         }
                     }
                 }
                 $header = array(Yii::t("default", "Item"), Yii::t("default", "Item Name"), Yii::t("default", "Size"), Yii::t("default", "Item Price"), Yii::t("default", "Total Qty"), Yii::t("default", "Total Amount"));
                 if ($has_date_range == true) {
                     $header[] = t("Start Date");
                     $header[] = t("End Date");
                 }
                 $filename = $this->data['rpt'] . '-' . date('c') . '.csv';
                 $excel = new ExcelFormat($filename);
                 $excel->addHeaders($header);
                 $excel->setData($data);
                 $excel->prepareExcel();
                 exit;
                 break;
             case "rptSalesMerchant":
                 if ($res = $db_ext->rst($stmt)) {
                     foreach ($res as $val) {
                         $data[] = array($val['merchant_id'], $val['restaurant_name'], $val['contact_name'], $val['contact_phone'] . " / " . $val['contact_email'], $val['street'] . " " . $val['city'] . " " . $val['state'] . " " . $val['country_code'] . " " . $val['post_code'], ucwords($val['package_name']), $val['status'], Yii::app()->functions->prettyDate($val['date_created'], true));
                     }
                 }
                 $header = array(Yii::t("default", "MerchantID"), Yii::t("default", "MerchantName"), Yii::t("default", "ContactName"), Yii::t("default", "Contact"), Yii::t("default", "Address"), Yii::t("default", "Package"), Yii::t("default", "Status"), Yii::t("default", "Date"));
                 $filename = $this->data['rpt'] . '-' . date('c') . '.csv';
                 $excel = new ExcelFormat($filename);
                 $excel->addHeaders($header);
                 $excel->setData($data);
                 $excel->prepareExcel();
                 exit;
                 break;
                 break;
             case 'rptAdminSalesMerchant':
                 if ($res = $db_ext->rst($stmt)) {
                     foreach ($res as $val) {
                         $date = prettyDate($val['date_created'], true);
                         $date = Yii::app()->functions->translateDate($date);
                         $data[] = array($val['order_id'], ucwords($val['client_name']), $val['item'], ucwords(Yii::t("default", $val['trans_type'])), strtoupper(Yii::t("default", $val['payment_type'])), standardPrettyFormat($val['sub_total'], $merchant_id), standardPrettyFormat($val['tax'], $merchant_id), standardPrettyFormat($val['total_w_tax'], $merchant_id), ucwords($val['status']), $date);
                     }
                 }
                 $header = array(Yii::t("default", "Ref#"), Yii::t("default", "Name"), Yii::t("default", "Item"), Yii::t("default", "TransType"), Yii::t("default", "Payment Type"), Yii::t("default", "Total"), Yii::t("default", "Tax"), Yii::t("default", "Total W/Tax"), Yii::t("default", "Status"), Yii::t("default", "Date"));
                 $filename = $this->data['rpt'] . '-' . date('c') . '.csv';
                 $excel = new ExcelFormat($filename);
                 $excel->addHeaders($header);
                 $excel->setData($data);
                 $excel->prepareExcel();
                 exit;
                 break;
             case "rptCustomerList":
                 if ($res = $db_ext->rst($_SESSION['kr_export_stmt'])) {
                     foreach ($res as $val) {
                         $data[] = array($val['email_address'], $val['first_name'], $val['last_name']);
                     }
                 }
                 $header = array(t("Email"), t("firstname"), t("lastname"));
                 $filename = $this->data['rpt'] . '-' . date('c') . '.csv';
                 $excel = new ExcelFormat($filename);
                 $excel->addHeaders($header);
                 $excel->setData($data);
                 $excel->prepareExcel();
                 exit;
                 break;
             case "rptSubriberList":
                 if ($res = $db_ext->rst($_SESSION['kr_export_stmt'])) {
                     foreach ($res as $val) {
                         $date = prettyDate($val['date_created'], true);
                         $date = Yii::app()->functions->translateDate($date);
                         $data[] = array($val['id'], $val['email_address'], $date, $val['ip_address']);
                     }
                 }
                 $header = array(t("ID"), t("Email address"), t("Date Created"), t("I.P Address"));
                 $filename = $this->data['rpt'] . '-' . date('c') . '.csv';
                 $excel = new ExcelFormat($filename);
                 $excel->addHeaders($header);
                 $excel->setData($data);
                 $excel->prepareExcel();
                 exit;
                 break;
             case "rptmerchantcommission":
                 if ($res = $db_ext->rst($_SESSION['kr_export_stmt'])) {
                     foreach ($res as $val) {
                         $date = prettyDate($val['date_created'], true);
                         $date = Yii::app()->functions->translateDate($date);
                         $data[] = array($val['merchant_id'], $val['merchant_name'], normalPrettyPrice($val['total_order']), normalPrettyPrice($val['total_commission']));
                     }
                 }
                 $header = array(t("ID"), t("Merchant Name"), t("Total Price"), t("Commission Price"));
                 $filename = $this->data['rpt'] . '-' . date('c') . '.csv';
                 $excel = new ExcelFormat($filename);
                 $excel->addHeaders($header);
                 $excel->setData($data);
                 $excel->prepareExcel();
                 exit;
                 break;
             case "rptmerchantcommissiondetails":
                 $total_order = 0;
                 $total_commission = 0;
                 if ($res = $db_ext->rst($_SESSION['kr_export_stmt'])) {
                     foreach ($res as $val) {
                         $date = prettyDate($val['date_created'], true);
                         $date = Yii::app()->functions->translateDate($date);
                         $total_order = $total_order + $val['total_order'];
                         $total_commission = $total_commission + $val['total_commission'];
                         $data[] = array($val['order_id'], normalPrettyPrice($val['total_w_tax']), normalPrettyPrice($val['percent_commision']), normalPrettyPrice($val['total_commission']), $date);
                     }
                 }
                 $header = array(t("Reference #"), t("Total Price"), t("Commission (%)"), t("Commission price"), t("Date"));
                 $filename = $this->data['rpt'] . '-' . date('c') . '.csv';
                 $excel = new ExcelFormat($filename);
                 $excel->addHeaders($header);
                 $excel->setData($data);
                 $excel->prepareExcel();
                 exit;
                 break;
             case "rptmerchantstatement":
                 if ($res = $db_ext->rst($_SESSION['kr_export_stmt'])) {
                     foreach ($res as $val) {
                         $date = prettyDate($val['date_created'], true);
                         $date = Yii::app()->functions->translateDate($date);
                         $total = $val['total_w_tax'];
                         if ($val['commision_ontop'] == 1) {
                             $total = $val['sub_total'];
                         }
                         $total_commission = $val['total_commission'];
                         $amount = $total - $total_commission;
                         $data[] = array($val['order_id'], strtoupper($val['payment_type']), normalPrettyPrice($total), normalPrettyPrice($val['percent_commision']), normalPrettyPrice($total_commission), normalPrettyPrice($amount), $date);
                     }
                 }
                 $header = array(t("Reference #"), t("Payment Type"), t("Total Price"), t("Commission (%)"), t("Commission"), t("Net Amount"), t("Date"));
                 $filename = $this->data['rpt'] . '-' . date('c') . '.csv';
                 $excel = new ExcelFormat($filename);
                 $excel->addHeaders($header);
                 $excel->setData($data);
                 $excel->prepareExcel();
                 exit;
                 break;
             case "rptmerchantsalesummary":
                 $has_date_range = false;
                 if (isset($_SESSION['rpt_date_range'])) {
                     if (is_array($_SESSION['rpt_date_range'])) {
                         $has_date_range = true;
                     }
                 }
                 if ($res = $db_ext->rst($_SESSION['kr_export_stmt'])) {
                     foreach ($res as $val) {
                         if ($has_date_range == true) {
                             $data[] = array($val['restaurant_name'], normalPrettyPrice($val['total_sales'] + 0), normalPrettyPrice($val['total_commission'] + 0), normalPrettyPrice($val['total_earnings'] + 0), $_SESSION['rpt_date_range']['start_date'], $_SESSION['rpt_date_range']['end_date']);
                         } else {
                             $data[] = array($val['restaurant_name'], normalPrettyPrice($val['total_sales'] + 0), normalPrettyPrice($val['total_commission'] + 0), normalPrettyPrice($val['total_earnings'] + 0));
                         }
                     }
                 }
                 $header = array(t("Merchant Name"), t("Total Sales"), t("Total Commission"), t("Merchant Earnings"));
                 if ($has_date_range == true) {
                     $header[] = t("Start Date");
                     $header[] = t("End Date");
                 }
                 $filename = $this->data['rpt'] . '-' . date('c') . '.csv';
                 $excel = new ExcelFormat($filename);
                 $excel->addHeaders($header);
                 $excel->setData($data);
                 $excel->prepareExcel();
                 exit;
                 break;
             case "booking-summary-report":
                 $has_date_range = false;
                 if (isset($_SESSION['rpt_date_range'])) {
                     if (is_array($_SESSION['rpt_date_range'])) {
                         $has_date_range = true;
                     }
                 }
                 if ($res = $db_ext->rst($_SESSION['kr_export_stmt'])) {
                     foreach ($res as $val) {
                         if ($has_date_range == true) {
                             $data[] = array($val['total_approved'] + 0, $val['total_denied'] + 0, $val['total_pending'] + 0, $_SESSION['rpt_date_range']['start_date'], $_SESSION['rpt_date_range']['end_date']);
                         } else {
                             $data[] = array($val['total_approved'] + 0, $val['total_denied'] + 0, $val['total_pending'] + 0);
                         }
                     }
                 }
                 $header = array(t("Total Approved"), t("Total Denied"), t("Total Pending"));
                 if ($has_date_range == true) {
                     $header[] = t("Start Date");
                     $header[] = t("End Date");
                 }
                 $filename = $this->data['rpt'] . '-' . date('c') . '.csv';
                 $excel = new ExcelFormat($filename);
                 $excel->addHeaders($header);
                 $excel->setData($data);
                 $excel->prepareExcel();
                 exit;
                 break;
             case "merchanBbookingSummaryReport":
                 $has_date_range = false;
                 if (isset($_SESSION['rpt_date_range'])) {
                     if (is_array($_SESSION['rpt_date_range'])) {
                         $has_date_range = true;
                     }
                 }
                 if ($res = $db_ext->rst($_SESSION['kr_export_stmt'])) {
                     foreach ($res as $val) {
                         if ($has_date_range == true) {
                             $data[] = array(ucwords($val['merchant_name']), $val['total_approved'] + 0, $val['total_denied'] + 0, $val['total_pending'] + 0, $_SESSION['rpt_date_range']['start_date'], $_SESSION['rpt_date_range']['end_date']);
                         } else {
                             $data[] = array(ucwords($val['merchant_name']), $val['total_approved'] + 0, $val['total_denied'] + 0, $val['total_pending'] + 0);
                         }
                     }
                 }
                 $header = array(t("Merchant Name"), t("Total Approved"), t("Total Denied"), t("Total Pending"));
                 if ($has_date_range == true) {
                     $header[] = t("Start Date");
                     $header[] = t("End Date");
                 }
                 $filename = $this->data['rpt'] . '-' . date('c') . '.csv';
                 $excel = new ExcelFormat($filename);
                 $excel->addHeaders($header);
                 $excel->setData($data);
                 $excel->prepareExcel();
                 exit;
                 break;
             case "rpt_incomingwithdrawal":
                 if ($res = $db_ext->rst($_SESSION['kr_export_stmt'])) {
                     foreach ($res as $val) {
                         $date = date('M d,Y G:i:s', strtotime($val['date_created']));
                         $date = Yii::app()->functions->translateDate($date);
                         $date_created = displayDate($val['date_created']);
                         $date_to_process = displayDate($val['date_to_process']);
                         $method = t("Paypal to") . " " . $val['account'];
                         if ($val['payment_method'] == "bank") {
                             $method = t("Bank to") . " " . $val['bank_account_number'];
                         }
                         $data[] = array($val['withdrawal_id'], $val['merchant_name'], $method, normalPrettyPrice($val['amount']), normalPrettyPrice($val['current_balance']), $val['status'], $date_created, $date_to_process);
                     }
                 }
                 $header = array(t("ID"), t("Merchant Name"), t("Payment Method"), t("Amount"), t("From Balance"), t("Status"), t("Date Of Request"), t("Date to process"));
                 $filename = $this->data['rpt'] . '-' . date('c') . '.csv';
                 $excel = new ExcelFormat($filename);
                 $excel->addHeaders($header);
                 $excel->setData($data);
                 $excel->prepareExcel();
                 exit;
                 break;
             default:
                 break;
         }
     } else {
         echo Yii::t("default", "Error: Something went wrong. please try again.");
     }
 }
Example #24
0
<?php

session_start();
if (!isset($_SESSION['user']) || $_SESSION['user']->u_status != 1) {
    header("Location: index.php");
    exit;
}
include 'functions.php';
$page = 'profile';
$address = getAddress($_SESSION['user']->u_zip);
$age = getAge($_SESSION['user']->u_birthday);
$membershipDuration = displayDate($_SESSION['user']->u_register_date, '2');
$userTimeline = getUserTimeline($_SESSION['user']->u_id);
if ($_SESSION['user']->u_gender == 'Male') {
    $genderIcon = 'fa-male';
} else {
    if ($_SESSION['user']->u_gender == 'Female') {
        $genderIcon = 'fa-female';
    } else {
        $genderIcon = 'fa-genderless';
    }
}
$dietStatus = dietStatus();
$isUpUpdateRequired = isUpUpdateRequired();
if ($dietStatus) {
    $dietStats = getDietStats();
    if ($dietStats->ds_progress == 'P') {
        $icon_diet_progres_class = 'fa fa-smile-o fa-2x';
        $progress_status = '';
    } else {
        if ($dietStats->ds_progress == 'N') {
Example #25
0
							}

							}else{
							echo '<img class="img-slide-show" data-type="image" style="max-width:754px;max-height: 562px" src="' . callThumbListFrontEndByID($rowPic['PIC_ID'], $rowPic['CAT_ID'], true) . '">'."\n\t";
							$thumbRender .= '<img src="' . callThumbListFrontEndByID($rowPic['PIC_ID'], $rowPic['CAT_ID'], true) . '">'."\n\t";
							}
							echo '</div>'."\n\t";
							$thumbRender .= '</div>'."\n\t";
							}
					?>
					</div>
					<a class="btn-arrow-slide pev"></a>
					<a class="btn-arrow-slide next"></a>
					<div class="box-title-main">
						<div class="box-date-tumb">
							<p class="date"><?=displayDate($row['EVENT_START_DATE'])?></p>
							<p class="month"><?=displayShortMonth($row['EVENT_START_DATE'])?></p>
						</div>
						<div class="box-text">
							<p class="text-title"><? echo $row['CONTENT_LOC'] ?></p>
							<p class="text-des">by <? echo $row['USER_CREATE'] ?></p>
						</div>
					</div>
				</div>
				<div class="box-social-main cf">
				<?php

						$path = 'news-detail.php?MID='.$MID.'%26CID='.$CID.'%26SID='.$SID.'%26CONID='.$CONID;
						$fullpath = _FULL_SITE_PATH_.'/'.$path;
						$redirect_uri = _FULL_SITE_PATH_.'/callback.php?p='.$CONID;
						$fb_link = 'https://www.facebook.com/dialog/share?app_id='._FACEBOOK_ID_.'&display=popup&href='.$fullpath.'&redirect_uri='.$redirect_uri;
Example #26
0
 if ($row['msg_status'] == 1) {
     $msg_status_text = 'Success Withdraw';
 } else {
     if ($row['msg_status'] == 2) {
         $msg_status_text = 'Fail Withdraw';
     }
 }
 $bank_name = $this->m_custom->display_dynamic_option($row['msg_bank_id']);
 $user_name = $this->m_custom->generate_user_link($row['msg_from_id']);
 $admin_name = $this->m_custom->display_users($row['status_change_by']);
 $user_balance_text = $this->m_user->user_check_balance($row['msg_from_id']);
 $url_balance_adjust = base_url() . "admin/user_balance_adjust/" . $row['msg_from_id'] . "/" . $row['msg_id'];
 $url_withdraw_change = base_url() . "admin/user_withdraw_change/" . $row['msg_id'];
 $url_special_action = base_url() . "admin/user_withdraw";
 echo '<tr>';
 echo "<td>" . displayDate($row['msg_time']) . "</td>";
 echo "<td>" . $user_name . "</td>";
 echo "<td>" . $row['msg_content'] . "</td>";
 echo "<td>" . $bank_name . "</td>";
 echo "<td>" . $row['msg_desc'] . "</td>";
 echo "<td>" . $row['msg_remark'] . "</td>";
 echo "<td>" . $msg_status_text . "</td>";
 echo "<td>" . $admin_name . "</td>";
 echo "<td><a href='" . $url_withdraw_change . "' target='_blank'>" . $row['msg_reply'] . "</a></td>";
 echo "<td style='text-align:right'>" . $user_balance_text . "</td>";
 echo "<td>";
 $confirm_message = "Confirm that you want to do this?";
 //echo form_open($url_special_action);
 ?>
                         <form action="<?php 
 echo $url_special_action;
Example #27
0
                                </td>-->
                                <td>
                                    <div class="table-text-overflow-ellipsis">
                                        <a href='<?php 
        echo $advertise_detail_url;
        ?>
' target='_blank'><?php 
        echo $redeem_row['voucher'];
        ?>
</a>
                                    </div>
                                </td>
                                <td>
                                    <div class="table-text-overflow-ellipsis">
                                        <?php 
        echo displayDate($redeem_row['expired_date']);
        ?>
                                    </div>    
                                </td>
                            </tr>
                            <?php 
    }
    ?>
        
                    </table>
                </div>
            </div>
            <?php 
}
?>
       
Example #28
0
<?php

require_once 'common/functions.php';
require_once 'db/db.php';
$id = $_GET['id'];
$stmt = $db->prepare('SELECT comment.rowid, text, date, edition_date, edited, username FROM comment, user WHERE comment.rowid = :id and comment.user_id = user.id');
$stmt->bindparam(':id', $id);
$stmt->execute();
$comments = $stmt->fetchall();
$comment = $comments[0];
$comment['date_format'] = displayDate($comment['date']);
$comment['edition_date_format'] = displayDate($comment['edition_date']);
$comment['text'] = nl2br(stripslashes($comment['text']));
$ret = array();
array_push($ret, $comment);
echo json_encode($ret);
Example #29
0
								}else{
								echo '<img class="img-slide-show" data-type="image" style="max-width:754px;max-height: 562px" src="' . callThumbListFrontEndByID($rowPic['PIC_ID'], $rowPic['CAT_ID'], true) . '">'."\n\t";
								$thumbRender .= '<img src="' . callThumbListFrontEndByID($rowPic['PIC_ID'], $rowPic['CAT_ID'], true) . '">'."\n\t";
								}
								echo '</div>'."\n\t";
								$thumbRender .= '</div>'."\n\t";
								}
								?>
							</div>
							<a class="btn-arrow-slide pev"></a>
							<a class="btn-arrow-slide next"></a>
							<div class="box-title-main">
								<div class="box-date-tumb">
									<p class="date">
										<?=displayDate($eventRow['LAST_DATE']) ?>
									</p>
									<p class="month">
										<?=displayShortMonth($eventRow['LAST_DATE']) ?>
									</p>
								</div>
								<div class="box-text">
									<p class="text-title">
										<?=$eventRow['CONTENT_DESC'] ?>
									</p>
									<p class="text-des">
										<?=$eventRow['MUSEUM_NAME'] ?>
									</p>
								</div>
							</div>
						</div>
Example #30
0
function getYears($row)
{
    global $dates;
    $years = getGenderIcon($row['sex'], -1);
    if ($row['allow_living'] && $row['allow_private']) {
        if ($row['deathdate']) {
            $deathdate = $row['deathdate'];
            $truedeath = $row['deathdatetr'];
        } else {
            $deathdate = $row['burialdate'];
            $truedeath = $row['burialdatetr'];
        }
        $deathyearonly = $row['death'] && $row['death'] . "-00-00" == $truedeath ? true : false;
        $deathstr = displayDate($deathdate);
        $displaydeath = !$row['death'] || $deathyearonly ? $deathstr : getDatePrefix($deathstr) . $row['death'];
        $displaydeath = $displaydeath != "Y" ? $displaydeath : $dates['Y'];
        if ($row['birthdate']) {
            $birthdate = $row['birthdate'];
            $truebirth = $row['birthdatetr'];
        } else {
            $birthdate = $row['altbirthdate'];
            $truebirth = $row['altbirthdatetr'];
        }
        $birthyearonly = $row['birth'] && $row['birth'] . "-00-00" == $truebirth ? true : false;
        $birthstr = displayDate($birthdate);
        $displaybirth = !$row['birth'] || $birthyearonly ? $birthstr : getDatePrefix($birthstr) . $row['birth'];
        if ($displaybirth || $displaydeath) {
            $years .= " {$displaybirth} - {$displaydeath}";
            $age = age($row);
            if ($age) {
                $years .= " &nbsp;({$age})";
            }
        }
    }
    return $years;
}