D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home5
/
rakcha
/
public_html
/
user
/
Filename :
get_final_com.php
back
Copy
<?php include("includes/database.php"); $select_query = "select * from commitee"; $run = mysqli_query($con,$select_query); while ($row = mysqli_fetch_array($run)) { $member_no = $row['member_no']; $select_query_main = "select * from roi_tree where member_no='$member_no' ORDER BY tree_id ASC limit 1"; $run_main = mysqli_query($con,$select_query_main); while ($row_main = mysqli_fetch_array($run_main)) { $tree_id_main = $row_main['tree_id']; $group_number_main = $row_main['group_number']; $member_no_main = $row_main['member_no']; $user_id_main = $row_main['user_id']; $sponsor_no_main = $row_main['sponsor_no']; $relation_ship_no_main = $row_main['relation_ship_no']; $level_no_main = $row_main['level_no']; $x_position_main = $row_main['x_position']+1; $y_position_main = $row_main['y_position']; $roi_amount_main = $row_main['roi_amount']; $roi_status_main = $row_main['roi_status']; $product_amount_main = $row_main['product_amount']; $total_bv_main = $row_main['total_bv']; } if ($member_no == '024') { $extra_amount_bv = 0; } else { $extra_amount_bv = 0; } if ($roi_status_main == 0) { $personal_pv_join_1 = $roi_amount_main; } else { $personal_pv_join_1 = 0; } $personal_pv_join = $personal_pv_join_1+$extra_amount_bv; $arr1_10a_pro = array(); $select_query_findempty_pay_10a_pro = "select * from product_member where member_no = '$member_no_main'"; $run_findempty_pay_10a_pro = mysqli_query($con,$select_query_findempty_pay_10a_pro); while ($row_findempty_pay_10a_pro = mysqli_fetch_array($run_findempty_pay_10a_pro)) { $arr1_10a_pro[] = $row_findempty_pay_10a_pro['used_no']; } //get_product_bv $select_query_per_product_x1_10a = "select SUM(product_amount) from product_tree where member_no='$member_no_main' AND product_no not in (".implode(',', $arr1_10a_pro).")"; $run_per_product_x1_10a = mysqli_query($con,$select_query_per_product_x1_10a); while($row_per_product_x1_10a = mysqli_fetch_array($run_per_product_x1_10a)){ $p_per_product_x1_10a = $row_per_product_x1_10a['SUM(product_amount)']; } $total_single_leg = $personal_pv_join+$p_per_product_x1_10a; if ($total_single_leg >= 40) { mysqli_query($con,"update commitee set status='1' where member_no='$member_no'"); } else { mysqli_query($con,"update commitee set status='0' where member_no='$member_no'"); } ?> <?php } ?>