Esempio n. 1
0
echo $module_name;
?>
</div>
<div id="wrapper">
    <?php 
echo $list->showHeader($total_row);
?>
    <?php 
$i = 0;
?>
    <?php 
while ($row = mysqli_fetch_assoc($db_listing->result)) {
    $i++;
    ?>
    <?php 
    echo $list->start_tr($i, $row[$id_field]);
    ?>
    <td class="center">
        <div class="img_thumb">
            <img src="<?php 
    echo $bg_filepath;
    echo $row['use_avatar'];
    ?>
" alt="Không có ảnh"/>
        </div>
        <?php 
    echo form_upload('use_avatar' . $row[$id_field], '', 'onchage="check_edit(\'record_' . $i . '\')"');
    ?>
    </td>
    <td>
        <div class="row">
Esempio n. 2
0
 function listRecord()
 {
     global $id_field;
     global $bg_table;
     global $cat_field;
     $cat_id = getValue('cat_id', 'str', 'POST', 0);
     $html = '';
     $class_context_menu = 'menu-normal';
     #Bắt đầu với datagrid
     $list = new dataGrid($id_field, 30);
     /*code something*/
     $list->add('', 'Tên cửa hàng');
     $list->add('', 'Điện thoại');
     switch ($cat_id) {
         case 'all':
             $db_count = new db_count('SELECT count(*) as count
                                       FROM ' . $bg_table . '
                                       WHERE 1 ' . $list->sqlSearch());
             $total = $db_count->total;
             unset($db_count);
             $db_listing = new db_query('SELECT *
                         FROM ' . $bg_table . '
                         WHERE 1 ' . $list->sqlSearch() . '
                         ORDER BY ' . $list->sqlSort() . ' ' . $id_field . ' ASC
                         ' . $list->limit($total));
             $array_row = $db_listing->resultArray();
             unset($db_listing);
             break;
         case 'trash':
             $class_context_menu = 'menu-trash';
             $db_count = new db_count('SELECT count(*) as count
                         FROM trash
                         WHERE tra_table = "' . $bg_table . '"');
             $total = $db_count->total;
             unset($db_count);
             $array_row = trash_list($bg_table);
             $list->limit($total);
             break;
         default:
             $cat_id = (int) $cat_id;
             $db_count = new db_count('SELECT count(*) as count
                                       FROM ' . $bg_table . '
                                       WHERE 1 ' . $list->sqlSearch() . '
                                       AND ' . $cat_field . ' = ' . $cat_id);
             $total = $db_count->total;
             unset($db_count);
             $db_listing = new db_query('SELECT *
                                         FROM ' . $bg_table . '
                                         WHERE 1 ' . $list->sqlSearch() . '
                                         AND ' . $cat_field . ' = ' . $cat_id . '
                                         ORDER BY ' . $list->sqlSort() . ' ' . $id_field . ' ASC
                                         ' . $list->limit($total));
             $array_row = $db_listing->resultArray();
             unset($db_listing);
             break;
     }
     $total_row = count($array_row);
     $html .= $list->showHeader($total_row);
     $i = 0;
     foreach ($array_row as $row) {
         $i++;
         $html .= $list->start_tr($i, $row[$id_field], 'class="' . $class_context_menu . ' record-item" onclick="active_record(' . $row[$id_field] . ')" data-record_id="' . $row[$id_field] . '"');
         /*code something */
         $html .= '<td>' . $row['sed_name'] . '</td>';
         $html .= '<td class="right">' . $row['sed_phone'] . '</td>';
         $html .= $list->end_tr();
     }
     $html .= $list->showFooter();
     echo $html;
 }
Esempio n. 3
0
}
$total_row = mysqli_num_rows($db_financies_bill_out->result);
$bottom_right_column = '<div class="bottom_conten_right_column">';
$bottom_conten_right_column = '';
$bottom_conten_right_column .= $list->showHeader($total_row, '', 'id="table-listing-bot-right"');
$i = 0;
$total_all_pay_bill_out = 0;
while ($data_financies_bill_out = mysqli_fetch_assoc($db_financies_bill_out->result)) {
    $i++;
    if ($data_financies_bill_out['fin_pay_type'] == PAY_TYPE_CASH) {
        $fin_pay_type = 'Tiền mặt';
    }
    if ($data_financies_bill_out['fin_pay_type'] == PAY_TYPE_CARD) {
        $fin_pay_type = 'Thẻ';
    }
    $bottom_conten_right_column .= $list->start_tr($i, $data_financies_bill_out['fin_id'], 'class="menu-normal record-item" ondblclick="detail_financies(' . $data_financies_bill_out['fin_id'] . ')" data-record_id="' . $data_financies_bill_out['fin_id'] . '"');
    $bottom_conten_right_column .= '<td class="center" width="100">' . format_codenumber($data_financies_bill_out['fin_id'], 6, '') . '</td>';
    $bottom_conten_right_column .= '<td class="center" width="100">' . date('d/m/Y', $data_financies_bill_out['fin_updated_time']) . '</td>';
    $bottom_conten_right_column .= '<td class="text-right" width="100">' . number_format($data_financies_bill_out['fin_money']) . '</td>';
    $bottom_conten_right_column .= '<td class="center" width="100">' . $fin_pay_type . '</td>';
    $bottom_conten_right_column .= '<td>' . $data_financies_bill_out['fin_note'] . '</td>';
    $bottom_conten_right_column .= $list->end_tr();
    $total_all_pay_bill_out += $data_financies_bill_out['fin_money'];
}
unset($db_financies_bill_out);
$bottom_conten_right_column .= $list->showFooter();
$bottom_conten_right_column .= '<div class="total-pos">
    <div class="col-xs-6-lft col-xs-6-lft-l">
        <span>Tổng Cộng:</span><input class="ttl-hd" value="" readonly="readonly"/>
    </div>
    <div class="col-xs-6-rgh col-xs-6-lft-r">
Esempio n. 4
0
 /* Hiển thị tên tên bàn*/
 $db_section = new db_query('SELECT * FROM desks WHERE des_id = ' . $row['bii_desk_id'] . '');
 $row_sec = mysqli_fetch_assoc($db_section->result);
 //query vi tri
 $db_location = new db_query('SELECT * FROM sections WHERE sec_id =' . $row_sec['des_sec_id'] . '');
 $row_location = mysqli_fetch_assoc($db_location->result);
 $location = $row_sec['des_name'] . ' - ' . $row_location['sec_name'];
 /* Số tiền tổng tiền*/
 $vat_value = $row['bii_vat'] / 100;
 $total_money_ext = $row['bii_true_money'] - $row['bii_true_money'] * $row['bii_discount'] / 100 + $row['bii_true_money'] * $row['bii_extra_fee'] / 100;
 $total_money_real = $total_money_ext * (1 + $vat_value);
 unset($db_location);
 unset($db_section);
 $money_real = round($total_money_real, -3) - $row['bii_money_debit'];
 $i++;
 $content_column .= $list->start_tr($i, $row[$id_field], 'class="menu-normal record-item" data-record_id="' . $row[$id_field] . '"');
 /* code something */
 $content_column .= '<td class="center">' . date('d/m/Y h:i', $row['bii_start_time']) . '</td>';
 $content_column .= '<td class="center">' . $location . '</td>';
 $content_column .= '<td class="center">' . format_codenumber($row['bii_id'], 6, PREFIX_BILL_CODE) . '</td>';
 $content_column .= '<td class="text-right">' . number_format($row['bii_true_money']) . '</td>';
 // Số tiền tổng chưa giảm
 $content_column .= '<td class="text-right">' . number_format($row['bii_true_money'] * $row['bii_discount'] / 100) . '</td>';
 $content_column .= '<td class="text-right">' . number_format($row['bii_true_money'] * $row['bii_extra_fee'] / 100) . '</td>';
 $content_column .= '<td class="text-right">' . number_format($total_money_ext * $row['bii_vat'] / 100) . '</td>';
 $content_column .= '<td class="text-right">' . number_format(round($total_money_real, -3)) . '</td>';
 $content_column .= '<td class="text-right">' . number_format($row['bii_type'] == 0 ? $money_real : 0) . '</td>';
 /* Tiền mặt*/
 $content_column .= '<td class="text-right">' . number_format($row['bii_type'] == 1 ? $money_real : 0) . '</td>';
 $content_column .= '<td class="text-right">' . number_format($row['bii_money_debit']) . '</td>';
 $content_column .= $list->end_tr();
Esempio n. 5
0
                            FROM ' . $bg_table . '
                            LEFT JOIN customer_cat ON customers.cus_cat_id = customer_cat.cus_cat_id
                            WHERE 1 ' . $list->sqlSearch() . $db_extra . '
                            ORDER BY ' . $list->sqlSort() . ' ' . $id_field . ' ASC
                            ' . $list->limit($total));
$total_row = mysqli_num_rows($db_listing->result);
$right_column .= $list->showHeader($total_row);
$i = 0;
while ($row = mysqli_fetch_assoc($db_listing->result)) {
    $i++;
    if (!$row['cus_code']) {
        $customer_code = format_codenumber($row['cus_id'], 6, PREFIX_CUSTOMER_CODE);
    } else {
        $customer_code = $row['cus_code'];
    }
    $right_column .= $list->start_tr($i, $row[$id_field], 'class="menu-normal record-item" data-customer_code="' . $customer_code . '" data-customer_name="' . $row['cus_name'] . '" data-customer_discount="' . $row['cus_cat_discount'] . '" ondblclick="addToParentWindow(' . $row[$id_field] . ')" onclick="active_record(' . $row[$id_field] . ')" data-record_id="' . $row[$id_field] . '"');
    /* code something */
    $right_column .= '<td class="center">' . format_codenumber($row['cus_id'], 6, PREFIX_CUSTOMER_CODE) . '</td>';
    $right_column .= '<td class="center">' . $row['cus_code'] . '</td>';
    $right_column .= '<td class="center">' . $row['cus_name'] . '</td>';
    $right_column .= '<td class="center">' . $row['cus_address'] . '</td>';
    $right_column .= '<td class="center">' . $row['cus_phone'] . '</td>';
    $right_column .= $list->end_tr();
}
$right_column .= $list->showFooter();
//Phần option lựa chọn customer
$right_column .= '<div class="clearfix"></div>
<div class="col-xs-12">
    <span class="col-xs-4"></span>
    <span class="col-xs-8 text-right"><i>Bấm đúp chuột vào một nhân viên để chọn</i>&nbsp;&nbsp;&nbsp;&nbsp; <i class="fa fa-bell-o"></i> Chọn</span>
</div>';
Esempio n. 6
0
    if (!$row['inv_staff_id']) {
        $staff_name = '';
    } else {
        $staff_name = $list_users[$row['inv_staff_id']];
    }
    if (!$row['inv_store_id']) {
        $store_name = '';
    } else {
        $store_name = $list_store[$row['inv_store_id']];
    }
    if (!$row['inv_admin_id']) {
        $admin_name = '';
    } else {
        $admin_name = $list_admin[$row['inv_admin_id']];
    }
    $listing_menu .= $list->start_tr($i, $row['inv_id'], 'class="menu-trash record-item" id="record_' . $row['inv_id'] . '" onclick="active_record(' . $row['inv_id'] . ')" data-record_id="' . $row['inv_id'] . '"');
    /* code something */
    $listing_menu .= '<td class="center">' . format_codenumber($row['inv_id'], 6) . '</td>';
    $listing_menu .= '<td class="center">' . $staff_name . '</td>';
    $listing_menu .= '<td class="center">' . date('d/m/Y H:i', $row['inv_time']) . '</td>';
    $listing_menu .= '<td class="center">' . $store_name . '</td>';
    $listing_menu .= '<td class="center">' . $admin_name . '</td>';
    $listing_menu .= $list->end_tr();
}
$listing_menu .= $list->showFooter();
$content_column .= $listing_menu;
$content_column .= '</div>';
$rainTpl = new RainTPL();
add_more_css('custom.css', $load_header);
$rainTpl->assign('load_header', $load_header);
$custom_script = file_get_contents('custom_script_inventory.html');
Esempio n. 7
0
                         FROM admin_users
                         WHERE adm_group_id = ' . $group . ' ' . $list->sqlSearch() . '
                         ');
                 $total = $db_count->total;
                 unset($db_count);
                 $db_listing = new db_query('SELECT *
                         FROM admin_users
                         WHERE adm_group_id = ' . $group . '  ' . $list->sqlSearch() . '
                         ORDER BY ' . $list->sqlSort() . ' ' . $id_field . ' DESC
                         ' . $list->limit($total));
                 $total_row = mysqli_num_rows($db_listing->result);
                 $right_column .= $list->showHeader($total_row);
                 $i = 0;
                 while ($row = mysqli_fetch_assoc($db_listing->result)) {
                     $i++;
                     $right_column .= $list->start_tr($i, $row[$id_field], 'class="context-menu-user" onclick="selectRow(' . $row[$id_field] . ')" data-user-id="' . $row[$id_field] . '"');
                     $right_column .= '<td>' . $row['adm_loginname'] . '</td>';
                     $right_column .= '<td>' . $row['adm_name'] . '</td>';
                     $right_column .= '<td>' . $row['adm_note'] . '</td>';
                     $right_column .= $list->end_tr();
                 }
                 $right_column .= $list->showFooter();
                 echo $right_column;
             }
             break;
     }
     break;
     //phục hồi dữ liệu
 //phục hồi dữ liệu
 case 'recycleRow':
     $user_id = getValue('user', 'int', 'POST', 0);
Esempio n. 8
0
                            FROM menus
                            WHERE 1 ' . $list->sqlSearch() . $sql_search . '
                            ORDER BY ' . $list->sqlSort() . ' men_id ASC
                            ' . $list->limit($total));
$total_row = mysqli_num_rows($db_listing->result);
$listing_menu .= $list->showHeader($total_row);
$i = 0;
// tạo mảng đơn vị tính
$array_unit = array();
$db_query = new db_query('SELECT * FROM units');
while ($row = mysqli_fetch_assoc($db_query->result)) {
    $array_unit[$row['uni_id']] = $row['uni_name'];
}
while ($row = mysqli_fetch_assoc($db_listing->result)) {
    $i++;
    $listing_menu .= $list->start_tr($i, $row['men_id'], 'class="menu-normal record-item" ondblclick="mindowScript.addMenus(' . $row['men_id'] . ')" data-record_id="' . $row['men_id'] . '" data-men_name="' . $row['men_name'] . '" data-men_unit="' . $array_unit[$row['men_unit_id']] . '"');
    /* code something */
    $listing_menu .= '<td class="center">' . $row['men_name'] . '</td>';
    $listing_menu .= '<td class="center">' . $array_unit[$row['men_unit_id']] . '</td>';
    $listing_menu .= $list->end_tr();
}
$listing_menu .= $list->showFooter();
//phân trang ajax
//ajax paging
if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
    //catching ajax request
    $action = getValue('action', 'str', 'POST', '', 3);
    switch ($action) {
        case 'searchAjax':
        case 'pagingAjax':
            $container = getValue('container', 'str', 'POST', '', 3);
Esempio n. 9
0
 function reportProducts()
 {
     $array_return = array();
     //lấy các giá trị bắn ajax về để xuất báo cáo
     $array_product = getValue('products', 'arr', 'POST', '');
     if (!$array_product) {
         $array_return['content'] = 'Chưa chọn sản phẩm';
         die(json_encode($array_return));
     }
     $store_id = getValue('store_id', 'int', 'POST', 0);
     if (!$store_id) {
         $array_return['content'] = 'Chưa chọn kho hàng';
         die(json_encode($array_return));
     }
     $start_date = convertDateTime(getValue('start_date', 'str', 'POST', ''), '0:0:0');
     $end_date = convertDateTime(getValue('end_date', 'str', 'POST', ''), '0:0:0');
     // select ra báo cáo với các thông tin trên
     //lấy số lượng nhập hàng
     $arr_pro = array();
     foreach ($array_product as $product) {
         $arr_pro[] = $product;
     }
     $arr_pro = implode(',', $arr_pro);
     $left_column = '';
     //Hiển thị danh sách phiếu thu bên trái
     #Bắt đầu với datagird
     $list = new dataGrid('pro_id', 100);
     $list->add('', 'Tên mặt hàng');
     $list->add('', 'ĐVT');
     $list->add('', 'SL nhập');
     $list->add('', 'Tổng tiền tồn');
     // tảo mảng bill_id lọc theo thời gian và theo kho hàng
     $array_bill = array();
     $db_bill_out = new db_query('SELECT bio_id FROM bill_out WHERE bio_start_time >= ' . $start_date . '
                                  AND bio_start_time <=' . $end_date . ' AND bio_store_id = ' . $store_id . '');
     while ($row_bill_out = mysqli_fetch_assoc($db_bill_out->result)) {
         $array_bill[] = $row_bill_out['bio_id'];
     }
     unset($db_bill_out);
     $array_bill = implode(',', $array_bill);
     if ($array_bill == null) {
         $sql_search = ' AND bid_bill_id IN(0)';
     } else {
         $sql_search = ' AND bid_pro_id IN(' . $arr_pro . ') AND bid_bill_id IN(' . $array_bill . ')';
     }
     // select list danh
     $db_count = new db_count('SELECT count(*) as count
                         FROM bill_out_detail
                         WHERE 1 ' . $list->sqlSearch() . $sql_search . '
                         GROUP BY bid_pro_id
                         ');
     $total = $db_count->total;
     unset($db_count);
     $sql_query = 'SELECT * FROM bill_out_detail
                         WHERE 1 ' . $list->sqlSearch() . $sql_search . '
                         GROUP BY bid_pro_id
                         ORDER BY ' . $list->sqlSort() . ' bid_pro_id ASC
                         ' . $list->limit($total);
     $db_listing = new db_query($sql_query);
     $total_row = mysqli_num_rows($db_listing->result);
     //tao mang hien thi ten product
     $array_pro_name = array();
     $db_product = new db_query('SELECT pro_id,pro_name FROM products');
     while ($row_pro = mysqli_fetch_assoc($db_product->result)) {
         $array_pro_name[$row_pro['pro_id']] = $row_pro['pro_name'];
     }
     //Vì đây là module cần 2 table listing nên khai báo thêm table_extra id=table-listing-left
     $left_column .= $list->showHeader($total_row, '', 'id="table-listing-right"');
     $i = 0;
     $total_all = 0;
     while ($row = mysqli_fetch_assoc($db_listing->result)) {
         $i++;
         // lấy ra pro_unit_id để
         $db_query_unit = new db_query('SELECT pro_unit_id FROM products WHERE pro_id = ' . $row['bid_pro_id'] . ' ');
         $row_pro_unit = mysqli_fetch_assoc($db_query_unit->result);
         // lấy ra đơn vị tính của sản phẩm
         $db_unit_name = new db_query('SELECT uni_name FROM units WHERE uni_id = ' . $row_pro_unit['pro_unit_id'] . '');
         $row_unit = mysqli_fetch_assoc($db_unit_name->result);
         //tính tổng số lượng và giá tiền theo mặt hàng
         $db_price_ave = new db_query('SELECT SUM(bid_pro_price) AS total_price,
                                         SUM(bid_pro_number) AS total_number
                                         FROM bill_out_detail
                                         WHERE bid_pro_id = ' . $row['bid_pro_id'] . '');
         $row_total = mysqli_fetch_assoc($db_price_ave->result);
         $left_column .= $list->start_tr($i, $row['bid_pro_id'], 'class="menu-normal record-item" data-record_id="' . $row['bid_pro_id'] . '"');
         /* code something */
         $left_column .= '<td class="text-left">' . $array_pro_name[$row['bid_pro_id']] . '</td>';
         $left_column .= '<td width="100" class="center">' . $row_unit['uni_name'] . '</td>';
         $left_column .= '<td width="120" class="text-right">' . $row_total['total_number'] . '</td>';
         $left_column .= '<td width="120"  class="text-right">' . number_format($row_total['total_price']) . '</td>';
         // tổng tiền tất cả mặt hàng đã chọn
         $total_all += $row_total['total_number'] * $row_total['total_price'];
         $left_column .= $list->end_tr();
     }
     unset($db_count_price);
     unset($db_price_ave);
     unset($db_listing);
     unset($db_unit_name);
     unset($db_query_unit);
     $left_column .= $list->showFooter();
     $array_return['content'] = $left_column;
     $array_return['total'] = number_format($total_all);
     die(json_encode($array_return));
 }
Esempio n. 10
0
unset($db_count);
$db_listing = new db_query('SELECT *
                            FROM menus
                            INNER JOIN current_desk_menu ON cdm_menu_id = men_id
                            WHERE cdm_desk_id = ' . $record_id . '
                            ' . $list->limit($total));
$total_row = mysqli_num_rows($db_listing->result);
$listing_menu .= $list->showHeader($total_row);
//tổng tiền của bàn
$from_desk_total = 0;
$json_menu = array();
$i = 0;
while ($row = mysqli_fetch_assoc($db_listing->result)) {
    $i++;
    $from_desk_total += $row['cdm_price'] * $row['cdm_number'];
    $listing_menu .= $list->start_tr($i, $row['men_id'], 'onclick="deskSplit.activeMenu(' . $row['men_id'] . ',\'from\')" class="menu-normal record-item" data-record_id="' . $row['men_id'] . '"');
    /* code something */
    $listing_menu .= '<td class="center">' . $row['men_name'] . '</td>';
    $listing_menu .= '<td class="center">' . $array_unit[$row['men_unit_id']] . '</td>';
    $listing_menu .= '<td class="center">' . $row['cdm_number'] . '</td>';
    $listing_menu .= $list->end_tr();
    $json_menu[$row['men_id']] = array('men_id' => $row['men_id'], 'men_name' => $row['men_name'], 'men_number' => $row['cdm_number'], 'men_price' => $row['cdm_price'], 'men_unit' => $array_unit[$row['men_unit_id']]);
}
$listing_menu .= $list->showFooter();
$left_column .= $listing_menu;
$left_column .= '</div>';
$footer_control = '';
$rainTpl = new RainTPL();
add_more_css('css/custom_desks.css', $load_header);
$rainTpl->assign('load_header', $load_header);
$custom_script = file_get_contents('script_split_desk.html');
Esempio n. 11
0
// đếm số lượng mặt hàng kiểm kê
$db_count = new db_count('SELECT count(*) as count
                                  FROM inventory_products
                                  WHERE inv_id = ' . $record_id . '');
$total = $db_count->total;
unset($db_count);
// lấy ra số lượng các phiếu kiểm kê trong thùng rác
$db_listing = new db_query('SELECT * FROM inventory_products
                            WHERE inv_id = ' . $record_id . ' ORDER BY inv_product_id ASC
                            ' . $list->limit($total));
$total_row = mysqli_num_rows($db_listing->result);
$i = 0;
$listing_product .= $list->showHeader($total_row);
while ($row = mysqli_fetch_assoc($db_listing->result)) {
    $i++;
    $listing_product .= $list->start_tr($i, $row['inv_id'], 'class="menu-trash record-item" id="record_' . $row['inv_product_id'] . '"  data-record_id="' . $row['inv_product_id'] . '"');
    /* code something */
    $listing_product .= '<td class="center">' . format_codenumber($row['inv_product_id'], 6) . '</td>';
    $listing_product .= '<td class="center">' . $list_product[$row['inv_product_id']] . '</td>';
    $listing_product .= '<td class="center">' . $row['inp_quantity_system'] . '</td>';
    $listing_product .= '<td class="center">' . $row['inp_quantity_real'] . '</td>';
    $listing_product .= $list->end_tr();
}
$listing_product .= $list->showFooter();
$content_column .= $listing_product;
$rainTpl = new RainTPL();
add_more_css('custom.css', $load_header);
$rainTpl->assign('load_header', $load_header);
$custom_script = file_get_contents('script_half.html');
$rainTpl->assign('custom_script', $custom_script);
$rainTpl->assign('content_column', $content_column);
Esempio n. 12
0
$listing_product .= $list->showHeader($total_row);
$i = 0;
$array_unit = array();
$db_query = new db_query('SELECT * FROM units');
while ($row = mysqli_fetch_assoc($db_query->result)) {
    $array_unit[$row['uni_id']] = $row['uni_name'];
}
while ($row = mysqli_fetch_assoc($db_listing->result)) {
    $i++;
    if (!$row['pro_unit_id'] || !isset($array_unit[$row['pro_unit_id']])) {
        $array_unit[$row['pro_unit_id']] = '';
    }
    $row['pro_code'] = format_codenumber($row['pro_id'], 6, PREFIX_PRODUCT_CODE);
    $row['pro_unit'] = $array_unit[$row['pro_unit_id']];
    $row['pro_image'] = get_picture_path($row['pro_image']);
    $listing_product .= $list->start_tr($i, $row['pro_id'], 'class="menu-normal record-item" onclick="ImportScript.activeProductListing(' . $row['pro_id'] . ')" ondblclick="ImportScript.addProduct(' . $row['pro_id'] . ')" data-record_id="' . $row['pro_id'] . '" data-pro_name="' . $row['pro_name'] . '" data-pro_code="' . $row['pro_code'] . '" data-pro_unit="' . $array_unit[$row['pro_unit_id']] . '" data-pro_image="' . $row['pro_image'] . '"');
    /* code something */
    $listing_product .= '<td class="text-left" style="width : 50%">' . $row['pro_name'] . '</td>';
    $listing_product .= '<td class="center">' . $row['pro_unit'] . '</td>';
    $listing_product .= '<td class="text-right"></td>';
    $listing_product .= $list->end_tr();
    $list_product_array[] = $row;
}
$listing_product .= $list->showFooter();
$listing_product .= '<script>var ImportScript = ImportScript || {};ImportScript.productListData = ' . json_encode($list_product_array) . ';</script>';
$left_column .= $listing_product;
$left_column .= '</div>';
if ($isAjaxRequest) {
    $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : '';
    $ajax_container = isset($_REQUEST['container']) ? $_REQUEST['container'] : '';
    switch ($action) {
Esempio n. 13
0
$db_staff = new db_query('SELECT * FROM users');
while ($row_user = mysqli_fetch_assoc($db_staff->result)) {
    $staff_array[$row_user['use_id']] = $row_user['use_name'];
}
// tạo mảng để hiện thị kho hàng
$store_array = array();
$db_store = new db_query('SELECT * FROM categories_multi WHERE cat_type = "stores" ');
while ($row_store = mysqli_fetch_assoc($db_store->result)) {
    $store_array[$row_store['cat_id']] = $row_store['cat_name'];
}
//Vì đây là module cần 2 table listing nên khai báo thêm table_extra id=table-listing-left
$right_column .= $list->showHeader($total_row, '', 'id="table-listing-right"');
$i = 0;
while ($row = mysqli_fetch_assoc($db_listing->result)) {
    $i++;
    $right_column .= $list->start_tr($i, $row['sto_id'], 'class="menu-normal record-item" ondblclick="detail_stock_transfer(' . $row['sto_id'] . ')" onclick="active_record_r(' . $row['sto_id'] . ')" data-record_id="' . $row['sto_id'] . '"');
    /* code something */
    //Số phiếu - ID phiếu
    $right_column .= '<td class="center" width="">' . format_codenumber($row['sto_id'], 6) . '</td>';
    //Người trả
    $right_column .= '<td width="120" class="center">' . $staff_array[$row['sto_staff_id']] . '</td>';
    //Mô tả
    $right_column .= '<td class="center">' . date('d/m/Y H:i', $row['sto_time']) . '</td>';
    //số tiền
    $right_column .= '<td width="120" class="text-left">' . $store_array[$row['sto_from_storeid']] . '</td>';
    $right_column .= '<td width="120" class="text-left">' . $store_array[$row['sto_to_storeid']] . '</td>';
    $right_column .= $list->end_tr();
}
$right_column .= $list->showFooter();
//footer control
//Phần bộ lọc của phiếu thu
Esempio n. 14
0
 $db_listing = new db_query('SELECT *
                         FROM menus
                         WHERE 1 ' . $list->sqlSearch() . $sql_search . '
                         ORDER BY ' . $list->sqlSort() . ' men_id ASC
                         ' . $list->limit($total));
 $total_row = mysqli_num_rows($db_listing->result);
 $listing_menu .= $list->showHeader($total_row);
 $i = 0;
 $array_unit = array();
 $db_query = new db_query('SELECT * FROM units');
 while ($row = mysqli_fetch_assoc($db_query->result)) {
     $array_unit[$row['uni_id']] = $row['uni_name'];
 }
 while ($row = mysqli_fetch_assoc($db_listing->result)) {
     $i++;
     $listing_menu .= $list->start_tr($i, $row['men_id'], 'class="menu-normal record-item" ondblclick="addMenuToDesk(' . $row['men_id'] . ')" data-record_id="' . $row['men_id'] . '"');
     /* code something */
     $listing_menu .= '<td class="text-left">' . $row['men_name'] . '</td>';
     $listing_menu .= '<td class="center">' . $array_unit[$row['men_unit_id']] . '</td>';
     $listing_menu .= '<td class="text-right">' . format_number($row['men_price']) . '</td>';
     $listing_menu .= $list->end_tr();
 }
 $listing_menu .= $list->showFooter();
 //phân trang ajax
 //ajax paging
 if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
     //catching ajax request
     $action = getValue('action', 'str', 'POST', '', 3);
     switch ($action) {
         case 'searchAjax':
         case 'pagingAjax':
Esempio n. 15
0
 function fillerStockTransfer()
 {
     $right_column = '';
     //Hiển thị danh sách phiếu thu bên trái
     #Bắt đầu với datagird
     $list = new dataGrid('sto_id', 30);
     $list->add('', 'Số phiếu');
     $list->add('', 'Nhân viên chuyển');
     $list->add('', 'Ngày chuyển');
     $list->add('', 'Từ kho');
     $list->add('', 'Đến kho');
     // lấy biên từ form tìm kiếm theo ngày và nhân viên
     $start_date_in = getValue('start_date_in', 'str', 'POST', 0);
     $date_from = convertDateTime($start_date_in, '0:0:0');
     $end_date_in = getValue('end_date_in', 'str', 'POST', 0);
     $date_to = convertDateTime($end_date_in, '0:0:0');
     $staff_id = getValue('list_staff_id', 'int', 'POST', 0);
     if ($start_date_in && $end_date_in && $staff_id) {
         $search_sql = ' AND sto_time >=' . $date_from . ' AND sto_time <=' . $date_to . ' AND sto_staff_id = ' . $staff_id . ' ';
     } elseif ($staff_id) {
         $search_sql = ' AND sto_staff_id = ' . $staff_id . '';
     } elseif ($start_date_in && $end_date_in) {
         $search_sql = ' AND sto_time >=' . $date_from . ' AND sto_time <=' . $date_to . '';
     } else {
         $search_sql = '';
     }
     // slect list danh sách phiếu kiểm kê
     $db_count = new db_count('SELECT count(*) as count
                         FROM stock_transfer
                         WHERE 1 ' . $list->sqlSearch() . $search_sql . '
                         ');
     $total = $db_count->total;
     unset($db_count);
     $sql_query = 'SELECT *
                         FROM stock_transfer
                         WHERE 1 ' . $list->sqlSearch() . $search_sql . '
                         ORDER BY ' . $list->sqlSort() . ' sto_id DESC
                         ' . $list->limit($total);
     $db_listing = new db_query($sql_query);
     $total_row = mysqli_num_rows($db_listing->result);
     // tạo mảng để hiện thị tên nhân viên
     $staff_array = array();
     $db_staff = new db_query('SELECT * FROM users');
     while ($row_user = mysqli_fetch_assoc($db_staff->result)) {
         $staff_array[$row_user['use_id']] = $row_user['use_name'];
     }
     // tạo mảng để hiện thị kho hàng
     $store_array = array();
     $db_store = new db_query('SELECT * FROM categories_multi WHERE cat_type = "stores" ');
     while ($row_store = mysqli_fetch_assoc($db_store->result)) {
         $store_array[$row_store['cat_id']] = $row_store['cat_name'];
     }
     //Vì đây là module cần 2 table listing nên khai báo thêm table_extra id=table-listing-left
     $right_column .= $list->showHeader($total_row, '', 'id="table-listing-right"');
     $i = 0;
     while ($row = mysqli_fetch_assoc($db_listing->result)) {
         $i++;
         $right_column .= $list->start_tr($i, $row['sto_id'], 'class="menu-normal record-item" ondblclick="detail_stock_transfer(' . $row['sto_id'] . ')" dblclick="detail_record(' . $row['sto_id'] . ')" onclick="active_record(' . $row['sto_id'] . ')" data-record_id="' . $row['sto_id'] . '"');
         /* code something */
         //Số phiếu - ID phiếu
         $right_column .= '<td class="center" width="">' . format_codenumber($row['sto_id'], 6) . '</td>';
         //Người trả
         $right_column .= '<td width="120" class="center">' . $staff_array[$row['sto_staff_id']] . '</td>';
         //Mô tả
         $right_column .= '<td class="center">' . date('d/m/Y H:i', $row['sto_time']) . '</td>';
         //số tiền
         $right_column .= '<td width="120" class="text-left">' . $store_array[$row['sto_from_storeid']] . '</td>';
         $right_column .= '<td width="120" class="text-left">' . $store_array[$row['sto_to_storeid']] . '</td>';
         $right_column .= $list->end_tr();
     }
     $right_column .= $list->showFooter();
     $this->add($right_column);
 }
Esempio n. 16
0
                            FROM ' . $bg_table . '
                            WHERE 1 ' . $list->sqlSearch() . '
                            ');
$total = $db_count->total;
unset($db_count);
$db_listing = new db_query('SELECT *
                            FROM ' . $bg_table . '
                            WHERE 1 ' . $list->sqlSearch() . '
                            ORDER BY ' . $list->sqlSort() . ' ' . $id_field . ' ASC
                            ' . $list->limit($total));
$total_row = mysqli_num_rows($db_listing->result);
$right_column .= $list->showHeader($total_row);
$i = 0;
while ($row = mysqli_fetch_assoc($db_listing->result)) {
    $i++;
    $right_column .= $list->start_tr($i, $row[$id_field], 'class="menu-normal record-item" ondblclick="addToParentWindow(' . $row[$id_field] . ')" onclick="active_record(' . $row[$id_field] . ')" data-record_id="' . $row[$id_field] . '"');
    /* code something */
    $right_column .= '<td class="center">' . $row['sup_name'] . '</td>';
    $right_column .= '<td class="center">' . $row['sup_phone'] . '</td>';
    $right_column .= '<td>' . $row['sup_address'] . '</td>';
    $right_column .= $list->end_tr();
}
$right_column .= $list->showFooter();
$rainTpl = new RainTPL();
add_more_css('custom.css', $load_header);
$rainTpl->assign('load_header', $load_header);
$rainTpl->assign('module_name', $module_name);
$rainTpl->assign('error_msg', print_error_msg($bg_errorMsg));
$rainTpl->assign('left_control', $left_control);
$rainTpl->assign('right_control', $right_control);
$rainTpl->assign('left_column', $left_column);
Esempio n. 17
0
$total = mysqli_num_rows($db_count->result);
unset($db_count);
$db_list_bill = new db_query('SELECT *
                                    FROM ' . $tabel . ' INNER JOIN ' . $type_table . ' ON ' . $type_bill_id . ' = ' . $id_obj . '
                                    WHERE ' . $bill_status . ' = 0 ' . $And . '
                                    AND ' . $type_bill_id . ' = ' . $record_id . '
                                    ORDER BY ' . $list->sqlSort() . $bill_id . '
                                    ASC ' . $list->limit($total));
$total_row = mysqli_num_rows($db_list_bill->result);
$content_column .= '<div id="table_result">';
$table_result = '';
$table_result .= $list->showHeader($total_row);
$i = 0;
while ($data_bill = mysqli_fetch_assoc($db_list_bill->result)) {
    $i++;
    $table_result .= $list->start_tr($i, $data_bill[$bill_id], 'class="menu-normal record-item" onclick="active_record(' . $data_bill[$bill_id] . ')"');
    $table_result .= '<td class="center">' . format_codenumber($data_bill[$bill_id], 6, '') . '</td>';
    $table_result .= '<td class="center"  width="170">' . date("d-m-Y h:i", $data_bill[$date]) . '</td>';
    $table_result .= '<td class="text-right" width="100">' . number_format($data_bill[$debit]) . '</td>';
    $table_result .= '<td class="text-right"> </td>';
    $table_result .= '<td class="center">Chưa Thanh Toán</td>';
    $obj = $name_obj . ': <b>' . $data_bill[$name] . '</b>';
    $table_result .= $list->end_tr();
}
$table_result .= $list->showFooter();
$content_column .= $table_result;
$content_column .= '</div>';
$footer_control .= '<div class="name_obj">' . $obj . '</div>';
$footer_control .= '<span class="bill-close"><i class="fa fa-sign-out"></i> Đóng cửa sổ</span>';
if ($isAjaxRequest) {
    echo $table_result;
Esempio n. 18
0
                            WHERE 1 ' . $list->sqlSearch() . $sql_search . '
                            ORDER BY ' . $list->sqlSort() . ' pro_id DESC
                            ' . $list->limit($total));
$total_row = mysqli_num_rows($db_listing->result);
$listing_menu .= $list->showHeader($total_row);
/* tạo mảng đơn vị tính */
$array_unit = array();
$db_query = new db_query('SELECT * FROM units');
while ($row = mysqli_fetch_assoc($db_query->result)) {
    $array_unit[$row['uni_id']] = $row['uni_name'];
}
/* Hiện thị nội dung các bản ghi*/
$i = 0;
while ($row = mysqli_fetch_assoc($db_listing->result)) {
    $i++;
    $listing_menu .= $list->start_tr($i, $row['pro_id'], 'class="menu-normal record-item" ondblclick="mindowScript.addProducts(' . $row['pro_id'] . ')" data-record_id="' . format_codenumber($row['pro_id'], 6, PREFIX_PRODUCT_CODE) . '" data-pro_name="' . $row['pro_name'] . '" data-pro_unit="' . $array_unit[$row['pro_unit_id']] . '"');
    /* code something */
    $listing_menu .= '<td class="center">' . $row['pro_name'] . '</td>';
    $listing_menu .= '<td class="center">' . $array_unit[$row['pro_unit_id']] . '</td>';
    $listing_menu .= $list->end_tr();
}
$listing_menu .= $list->showFooter();
if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
    //catching ajax request
    $action = getValue('action', 'str', 'POST', '', 3);
    switch ($action) {
        case 'searchAjax':
        case 'pagingAjax':
            $container = getValue('container', 'str', 'POST', '', 3);
            if ($container == '#listing-menu') {
                echo $listing_menu;
Esempio n. 19
0
// lọc ra thông tin hóa đơn trong thùng rác
$array_bill = trash_list($table, $total, 0);
$i = 0;
$content_column .= '<div class="section-content">';
$content_column .= $list->showHeader($total, '', 'id="list_trash"');
foreach ($array_bill as $row) {
    $i++;
    if ($row[$id_object] == 0) {
        $name = $name_obj;
    } else {
        $db_list_bill = new db_query('SELECT ' . $name_object . ' FROM ' . $table_object . ' WHERE ' . $id . ' = ' . $row[$id_object]);
        $data_list_bill = mysqli_fetch_assoc($db_list_bill->result);
        unset($db_list_bill);
        $name = $data_list_bill[$name_object];
    }
    $content_column .= $list->start_tr($i, $row[$bill_id], 'class="menu-normal record-item" onclick="active_record(' . $row[$bill_id] . ')" data-table="' . $table . '" ondblclick="show_bill_detai()" data-record_id="' . $row[$bill_id] . '"');
    $content_column .= '<td>' . format_codenumber($row[$bill_id], 6, PREFIX_BILL_CODE) . '</td>';
    $content_column .= '<td>' . $name . '</td>';
    $content_column .= '<td class="center">' . date('d-m-Y', $row[$day_creat]) . '</td>';
    $content_column .= '<td class="text-right">' . number_format($row[$total_money]) . '</td>';
    $content_column .= '<td></td>';
    $content_column .= $list->end_tr();
}
$content_column .= $list->showFooter();
$content_column .= '</div>';
// footer
$footer_control .= '<div class="print-close">';
$footer_control .= '<span class="control-btn restore deactivate"><i class="fa fa-retweet"></i> Khôi phục</span>';
$footer_control .= '<span class="control-btn del_permanently deactivate"><i class="fa fa-file-excel-o"> Xóa vĩnh viễn</i></span> ';
$footer_control .= '<span class="control-btn deactivate view_detail"><i class="fa fa-list"></i> Xem chi tiết</span>';
$footer_control .= '<span class="control-btn deactivate information"><i class="fa fa-user"></i> Xem thông tin</span>';
Esempio n. 20
0
$table_right_column = '';
$table_right_column .= $list_right->showHeader($total_row, '', 'id="table-listing-right"');
$i = 0;
$totalAll_ = 0;
while ($row = mysqli_fetch_assoc($db_listing->result)) {
    $backgrouds = '';
    if ($row['bio_status'] == BILL_STATUS_DEBIT && $row['bio_money_debit'] != 0) {
        $backgrouds = 'style="background:#B3F8FF;"';
    }
    $supplier = new db_query('SELECT sup_name
                                   FROM suppliers
                                   WHERE sup_id = ' . $row['bio_supplier_id']);
    $row_ = mysqli_fetch_assoc($supplier->result);
    unset($supplier);
    $i++;
    $table_right_column .= $list_right->start_tr($i, $row[$id_field_o], '' . $backgrouds . ' class="menu-normal record-item" onclick="active_record(' . $row[$id_field_o] . ',\'right\')" data-debit="' . $row['bio_money_debit'] . '" data-record_id="' . $row[$id_field_o] . '" ondblclick="showDetail(\'right\')"');
    $table_right_column .= '<td class="center" width="80">' . format_codenumber($row[$id_field_o], 6, PREFIX_BILL_CODE) . '</td>';
    $table_right_column .= '<td>' . $row_['sup_name'] . '</td>';
    $table_right_column .= '<td class="center" width="130">' . date('d-m-Y H:i:s', $row['bio_start_time']) . '</td>';
    $table_right_column .= '<td class="text-right" width="100">' . number_format($row['bio_total_money']) . ' ' . DEFAULT_MONEY_UNIT . '</td>';
    $table_right_column .= $list_right->end_tr();
    $totalAll_ += $row['bio_total_money'];
}
$table_right_column .= $list_right->showFooter();
// lấy ra tổng tiền và tổng số hóa đơn
$table_right_column .= '<div class="total-pos">
    <div class="col-xs-6-lft col-xs-6-lft-l">
        <span>Tổng HĐ:</span><input class="ttl-hd" value="' . $total_ . '" readonly="readonly"/>
    </div>
    <div class="col-xs-6-rgh col-xs-6-lft-r">
        <span>Tổng tiền:</span><input class="ttl-hd" value="' . number_format($totalAll_) . ' ' . DEFAULT_MONEY_UNIT . '" readonly="readonly"/>
Esempio n. 21
0
            $fin_id[] = $same_day['id_fin'];
            $pay_Cash += $same_day['cash'];
            $pay_Card += $same_day['card'];
        }
    }
    if (count($fin_id) > 1) {
        $fin_id = implode('_', $fin_id);
    } else {
        $fin_id = implode('', $fin_id);
    }
    //
    $array_date['x'] = convertDateTime($date, '0:0:0');
    $array_date['y'] = intval($chiphi);
    $array[] = $array_date;
    //
    $right_column .= $list->start_tr($i, $fin_id, 'class="menu-normal record-item"');
    $right_column .= '<td class="center"> Trong ngày: ' . $date . '</td>';
    $right_column .= '<td class="center">' . $soHD . '</td>';
    $right_column .= '<td class="text-right">' . number_format($chiphi) . '</td>';
    $right_column .= '<td class="text-right">' . number_format($pay_Cash) . '</td>';
    $right_column .= '<td class="text-right">' . number_format($pay_Card) . '</td>';
    $right_column .= $list->end_tr();
}
$right_column .= $list->showFooter();
$right_column .= '<div id="chartContainer"></div>';
$title['title'] = "Chi phí theo quỹ tiền";
// total report
$total_report .= '<p class="select-title">Tổng chi phí:</p>';
$total_report .= '<p class="select-title total-cost"><strong>' . number_format($total_fund) . '</strong></p>';
//return ajax
if ($isAjaxRequest) {
Esempio n. 22
0
                            FROM ' . $bg_table . '
                            LEFT JOIN product_quantity ON pro_id = product_id
                            WHERE 1 ' . $list->sqlSearch() . $sql_search . '
                            ORDER BY ' . $list->sqlSort() . ' ' . $id_field . ' ASC
                            ' . $list->limit($total));
$total_row = mysqli_num_rows($db_listing->result);
$listing_product .= $list->showHeader($total_row);
$i = 0;
$array_unit = array();
$db_query = new db_query('SELECT * FROM units');
while ($row = mysqli_fetch_assoc($db_query->result)) {
    $array_unit[$row['uni_id']] = $row['uni_name'];
}
while ($row = mysqli_fetch_assoc($db_listing->result)) {
    $i++;
    $listing_product .= $list->start_tr($i, $row[$id_field], 'class="menu-normal record-item" ondblclick="detailRecord()" onclick="active_record(' . $row[$id_field] . ')" data-record_id="' . $row[$id_field] . '"');
    /* code something */
    $pro_unit_id = $row['pro_unit_id'];
    $listing_product .= '<td class="center" width="100">' . format_codenumber($row['pro_id'], 6, PREFIX_PRODUCT_CODE) . '</td>';
    $listing_product .= '<td class="center" width="100">' . $row['pro_code'] . '</td>';
    $listing_product .= '<td>' . $row['pro_name'] . '</td>';
    $listing_product .= '<td class="center" width="100">' . $array_unit[$row['pro_unit_id']] . '</td>';
    $listing_product .= '<td class="center" width="100">' . $row['pro_instock'] . '</td>';
    $listing_product .= '<td class="center" width="100">' . $row['pro_quantity'] . '</td>';
    $listing_product .= $list->end_tr();
}
$listing_product .= $list->showFooter();
$right_column .= $listing_product;
$right_column .= '</div>';
// show tab footer
$footer_control .= '
Esempio n. 23
0
$db_query_agen = new db_query('SELECT * FROM agencies');
while ($row = mysqli_fetch_assoc($db_query_agen->result)) {
    $array_agencies[$row['age_id']] = $row['age_name'];
}
unset($db_query_agen);
$db_listing = new db_query('SELECT *
                            FROM ' . $bg_table . '
                            WHERE 1 ' . $list->sqlSearch() . '
                            ORDER BY ' . $list->sqlSort() . ' ' . $id_field . ' ASC
                            ' . $list->limit($total));
$total_row = mysqli_num_rows($db_listing->result);
$left_column .= $list->showHeader($total_row);
$i = 0;
while ($row = mysqli_fetch_assoc($db_listing->result)) {
    $i++;
    $left_column .= $list->start_tr($i, $row[$id_field], 'class="menu-normal record-item" onclick="active_record(' . $row[$id_field] . ')" data-record_id="' . $row[$id_field] . '"');
    /* code something */
    $left_column .= '<td class="text-left" width="">' . $array_agencies[$row['pms_agency_id']] . '</td>';
    $left_column .= '<td class="text-left" width="">' . $row['pms_name'] . '</td>';
    $left_column .= '<td class="center" width="">' . date('d/m/Y H:i', $row['pms_start_time']) . '</td>';
    $left_column .= '<td class="center" width="">' . date('d/m/Y H:i', $row['pms_end_time']) . '</td>';
    $left_column .= $list->end_tr();
}
$left_column .= $list->showFooter();
$footer_control .= '
    <div class="clearfix"></div>
    <div class="button_tab">
        <ul>
             <li><a href="../customers/index.php" > <i class="fa fa-list"></i> DANH SÁCH KHÁCH HÀNG</a></li>
            <li><a href="#" id="button_tab_active"><i class="fa fa-bullhorn" ></i> CHIẾN DỊCH KHUYẾN MÃI</a></li>
        </ul>
            $so_no = $data_bill['bii_money_debit'] + $data_financial['fin_money'];
        }
    } elseif ($data_financial['fin_cat_id'] == 32) {
        $db_bill = new db_query('SELECT * FROM bill_out WHERE bio_id = ' . $data_financial['fin_billcode']);
        if ($data_bill = mysqli_fetch_assoc($db_bill->result)) {
            $ngay_no = $data_bill['bio_start_time'];
            $bill_id = $data_bill['bio_id'];
            $so_no = $data_bill['bio_money_debit'] + $data_financial['fin_money'];
        }
    }
    unset($db_bill);
}
unset($db_financies);
$content_column .= '<div class="section-content">';
$content_column .= $list->showHeader(1);
$content_column .= $list->start_tr(1, $bill_id, 'class="menu-normal record-item" data-record_id="' . $bill_id . '"');
$content_column .= '<td class="center">' . format_codenumber($bill_id, 6, '') . '</td>';
$content_column .= '<td class="center">' . date('d/m/Y h:i', $ngay_no) . '</td>';
$content_column .= '<td class="text-right">' . number_format($so_no) . '</td>';
$content_column .= '<td class="text-right">' . number_format($thanhtoan) . '</td>';
$content_column .= $list->end_tr();
$content_column .= $list->showFooter();
$content_column .= '</div>';
$custom_script = '<script>
    var windowHeight        = windowHeight || $(window).height();
    var wrapperHeight       = windowHeight;
    var wrapperContent      = $(\'#wrapper-full\');
    wrapperContent.height(wrapperHeight);
    var sectionContent_class = $(\'.section-content\');
    sectionContent_class.height(wrapperHeight - 10);
    var table_scoll = $(\'.table-listing-bound\');
Esempio n. 25
0
     if (trim($position) == 'right') {
         $pro_name = $row['pro_name'];
         $uni_name = $row['uni_name'];
     }
     if (trim($position) == 'bill_out') {
         $row = json_decode(base64_decode($row['tra_data']), 1);
         $db_pro_unit = new db_query('SELECT pro_name, uni_name FROM products 
                                         LEFT JOIN units ON pro_unit_id = uni_id
                                         WHERE pro_id = ' . $row['bid_pro_id']);
         $data_pro_unit = mysqli_fetch_assoc($db_pro_unit->result);
         unset($db_pro_unit);
         $pro_name = $data_pro_unit['pro_name'];
         $uni_name = $data_pro_unit['uni_name'];
     }
     $total = $row['bid_pro_price'] * $row['bid_pro_number'];
     $left_column .= $list->start_tr($i, $row['bid_pro_id'], 'class="menu-normal record-item" onclick="active_record(' . $row['bid_pro_id'] . ',\'left\')" data-record_id="' . $row['bid_pro_id'] . '"');
     $left_column .= '<td class="center">' . format_codenumber($row['bid_pro_id'], 6, '') . '</td>';
     $left_column .= '<td>' . $pro_name . '</td>';
     $left_column .= '<td class="center">' . $uni_name . '</td>';
     $left_column .= '<td class="center">' . $row['bid_pro_number'] . '</td>';
     $left_column .= '<td class="text-right">' . number_format($row['bid_pro_price']) . '</td>';
     $left_column .= '<td class="text-right">' . number_format($total) . '</td>';
     $left_column .= $list->end_tr();
     $totalAll += $total;
 }
 unset($menu_listing);
 $left_column .= $list->showFooter();
 // lay ra thong tin cua nha cug cap, trang thai thanh toan,ngay nhap khi xem chi tiet tu trang index
 if (trim($position) == 'right') {
     $db_date_brand_store_status = new db_query('SELECT * FROM bill_out
                                                         LEFT JOIN categories_multi ON bio_store_id = cat_id
Esempio n. 26
0
 *
 */
$list->add('dic_key', 'Nội dung', 'string', 1, 0);
$list->add('dic_translate_en', 'Bản dịch', 'string');
$list->add('', 'Edit', 'edit');
$list->add('', 'Delete', 'delete');
$db_count = new db_count('SELECT count(*) as count
                            FROM ' . $bg_table . '
                            WHERE 1 ' . $list->sqlSearch() . '
                            ');
$total = $db_count->total;
unset($db_count);
$db_listing = new db_query('SELECT *
                            FROM ' . $bg_table . '
                            WHERE 1 ' . $list->sqlSearch() . '
                            ORDER BY ' . $list->sqlSort() . ' ' . $id_field . ' DESC
                            ' . $list->limit($total));
$total_row = mysqli_num_rows($db_listing->result);
$table_header = $list->showHeader($total_row);
$rainTpl->assign('table_header', $table_header);
$table_footer = $list->showFooter();
$rainTpl->assign('table_footer', $table_footer);
$table_listing = array();
$i = 0;
while ($row = mysqli_fetch_assoc($db_listing->result)) {
    $i++;
    $array_td = array('<td width="50%">' . $row['dic_key'] . '</td>', '<td width="50%">' . $row['dic_translate_en'] . '</td>', $list->showEdit($row[$id_field]), $list->showDelete($row[$id_field]));
    $table_listing[] = array('start_tr' => $list->start_tr($i, $row[$id_field]), 'end_tr' => $list->end_tr(), 'array_td' => $array_td);
}
$rainTpl->assign('table_listing', $table_listing);
$rainTpl->draw('listing');
Esempio n. 27
0
$list->limit($total);
$total_row = count($array_row);
$content_column .= $list->showHeader($total_row, '', 'id="table-trash"');
$i = 0;
//Lấy ra list cửa hàng
$list_agencies = array();
$db_query_agencies = new db_query("SELECT * FROM agencies");
$list_agencies = array();
while ($row = mysqli_fetch_assoc($db_query_agencies->result)) {
    $list_agencies[$row['age_id']] = $row['age_name'];
}
unset($db_query_agencies);
// select các bản ghi trong thung rác
foreach ($array_row as $row) {
    $i++;
    $content_column .= $list->start_tr($i, $row[$id_field], 'class="' . $class_context_menu . ' record-item" onclick="active_record(' . $row[$id_field] . ')" data-record_id="' . $row[$id_field] . '"');
    //cửa hàng
    $content_column .= '<td class="text-left">' . $list_agencies[$row['pms_agency_id']] . '</td>';
    //tên chiến dịch
    $content_column .= '<td class="text-left">' . $row['pms_name'] . '</td>';
    //Ngày bắt đầu
    $content_column .= '<td class="center">' . date('d/m/Y H:i', $row['pms_start_time']) . '</td>';
    //Ngày kết thúc
    $content_column .= '<td class="center">' . date('d/m/Y H:i', $row['pms_end_time']) . '</td>';
    // giảm giá
    $content_column .= '<td class="center">' . $row['pms_value_sale'] . '</td>';
    //kiểu khuyến mãi
    $content_column .= '<td class="center">' . ($row['pms_type_sale'] ? '% phần trăm' : '$ tiền mặt') . '</td>';
    //số tiền
    $content_column .= '<td class="text-right">' . number_format($row['pms_condition']) . '</td>';
    $content_column .= $list->end_tr();