1) go to cpanel file manager directory :

public_html/crm/application/config

or

go to filezilla directory :

/var/www/html/crm/application/config

2) Ctrl + F find http and change all of them to https.







-----------------------------

Problem : Edit page content.

Withdraw_flamingo

member/withdraw_flamingo

arTpArray[i] = $(arTp[i]).text();

}



var arPurchase = $(".arpp").attr('id');

if (arPurchase == "Yes"){ var oppAR = "No"; var currentArP = 1;}

if (arPurchase == "No"){ var oppAR = "Yes"; var currentArP = 0;}

if ($.inArray(oppAR,arTpArray) > -1) {

update_auto_renew_to_database(currentArP);

}



---------------------------------------

Ajax Datatable error / 500 error mostly because mysql syntax error,

you may create a html page try to query database by your mysql to check where is the syntax error.

Previous case was WHERE order_method == 0; is wrong, should be order_method = 0;





----------------------------------------

WEEKDAY : 0=Monday, 1=Tuesday, 2=Wednesday, 3=Thursday, 4=Friday, 5=Saturday, 6=Sunday





-------------------------------------

$last_top_up_day = date('d/m/Y',strtotime('+21 days',strtotime(str_replace('/', '-', $flamingo_order_approved_date)))) . PHP_EOL;





-----------------------------------

mysql update multiple rows





$up_data1['star_bonus_per'] = $v1_star_bonus = $this->common->custom_safe_string($this->input->post('v1_star_bonus')); $up_data2['star_bonus_per'] = $v1_star_bonus = $this->common->custom_safe_string($this->input->post('v2_star_bonus')); $up_data3['star_bonus_per'] = $v1_star_bonus = $this->common->custom_safe_string($this->input->post('v3_star_bonus')); $up_data4['star_bonus_per'] = $v1_star_bonus = $this->common->custom_safe_string($this->input->post('v4_star_bonus')); $up_data5['star_bonus_per'] = $v1_star_bonus = $this->common->custom_safe_string($this->input->post('v5_star_bonus')); $this->common->updateRecord('tbl_agent_qualificaiton',$up_data1,"id=1"); $this->common->updateRecord('tbl_agent_qualificaiton',$up_data2,"id=2"); $this->common->updateRecord('tbl_agent_qualificaiton',$up_data3,"id=3"); $this->common->updateRecord('tbl_agent_qualificaiton',$up_data4,"id=4"); $this->common->updateRecord('tbl_agent_qualificaiton',$up_data5,"id=5");





----------------------------------------

change all email address in database

UPDATE tbl_user_master SET user_email = CONCAT( `unique_code` , "@test.com" );





-----------------------------------------

Array with value only, without key :

global $temp_paid_star_bonus_package; //declare at function getChildren() && function printList() $temp_paid_star_bonus_package = array(); //declare at function getChildren() $single_package_id= explode("#",$multiple_package_id); foreach($single_package_id as $package_id) { if($package_id != 0) { $temp_paid_star_bonus_package[] = $package_id; //add value into array } } foreach($temp_paid_star_bonus_package as $fpackage_id) //retrive value from array and insert into database { $up_data1['star_bonus_paid'] = 1; $this->common->updateRecord('tbl_flamingo_product_order',$up_data1,'id='.$fpackage_id);

}

Step : Cpanel > public_html/client.bfm.expert/application/views/member/network.php-----------------------------Migrate website to new server :Edit 3 files :1) /application/config/constant.php2) /application/config/database.php3) /application/config/config.phpif page error : No input file specified.Solution : go edit .htaccess file add ? after index.php become index.php?If 404 not found, then check folder permission. Change folder permission from 0750 to 0755 (tick allow read and execute for world)If sub folder, config.php should look like this :else if($_SERVER['HTTP_HOST'] == "2aek.com")$base_url = 'https://2aek.com/zac-work/';----------------------------change Email Sender FROM for email verification :file path : application > config > constants.phpdatabase : tbl_site_setting > scroll to right find column Email.---------------------------php mysql code file path at :application > controllers > member > Register.php--------------------------order package save poa into pdf file code path :controllers/member/Product.php-------------------------To echo $total_invested on dashboardfile 1 : application/views/member/dashboard.php : $this->load->view("member/inc_statistics");file 2 : application/views/member/inc_statistics.php : $total_invested;file 3 : application/libraries/Common.php : function getTotalInvested($user_id=0){}file 4 : application/controllers/member/Dashboard.php : $data['total_invested'] = $this->common->getTotalInvested();To echo $member_active_status on dashboardfile 1 : application/views/member/dashboard.php : $member_active_status = $this->Member_model->checkMemberKycStatus()file 2 : application/models/Member_model.php : function checkMemberKycStatus($user_id=0){}-----------------------To change timedate timezone:application/constant.php------------------------javascript and jquery file atapplication/views/member/inc_common_validation_all.php-----------------------To check if package purchase date is greater than a specific date :To check if today is 3 days after package purchase date :1) mysql WHERE .... && ((created_on < '2020-02-18') || (created_on > '2020-02-18' && created_on <= SUBDATE(CURDATE(), INTERVAL 3 DAY)))";2) mysql WHERE ...AND ((o.created_on < '2020-02-18') OR (o.created_on > '2020-02-18' AND o.created_on <= SUBDATE(CURDATE(), INTERVAL 3 DAY)))3) WHERE... AND DATEDIFF(CURDATE(),created_on) >= 2-----------------------------------------------javascript function change_status(id, url) is save atapplication/views/secure/inc_footer.php-----------------------------------------------error 404 page not foundif u want to create a new page,Step 1 : create html at view/withdraw_flamingo.php (must 1st character capital big, _ small capitalStep 2 : create php at controllers/withdraw_flamingo.phpStep 3 : add class and load->view at the php file that u created on (Step2) :classextends CI_Controller{ function index($tran_account=0)$this->load->view('', $data);----------------------------------------------if ajax error, then delete html may fix ajax error-------------------------------------------if return 1 instead of 1500then change$data['Rows1'] = $Result1->row_array();to$data['Rows1'] = $Result1->result_array();--------------------------------------------ajax sort has bug?file path : application/controllers/secure/Manage_flamingo_product_orders.php$column_order = array('u.id','u.id','u.created_on','unique_code', 'm.first_name AS fname', 'u.package_amount', 'u.user_sign', 'u.auto_renew','u.status', 'u.poa_path', 'u.package_id');The code above must in correct sequence from left to right fields on html table in views folder.-----------------------------------------ajax echo database record on to html tablefile path : application/controllers/secure/Manage_flamingo_product_orders.phpforeach ($Rows as $Res)$no++;$row = array();$row[] = $no;$row[] = 'F'.PACKAGE_PREFIX.str_pad($Res['id'], 6, '0', STR_PAD_LEFT);$row[] = $Res['created_on'];$row[] = $Res['unique_code'];$row[] = $Res['fname'];$row[] = $Res['package_amount'];----------------------------------------simple database query echo on html page :$placement = $this->common->getSelectedOneRow("placement", "tbl_user_master", "WHERE user_id = '".$this->session->userdata('WDW_MEMBER_LOGIN_ID')."'");if ($placement['placement'] == ""){---------------------------------------------SUM(amount) no need to use getAllRow, you can use getSelectedOneRow :$withdraw_pending = $this->getSelectedOneRow("Sum(withdraw_amount) AS withdraw_pending_amount","tbl_withdraw_request","WHERE user_id = '".$user_id."' AND status=0 AND tran_account=$tran_account");-------------------------------------------Select multiple records from database :$withdraw_pending = $this->getAllRec("Sum(withdraw_amount) AS withdraw_pending_amount","tbl_withdraw_request","WHERE user_id = '".$user_id."' AND status=0 AND tran_account=$tran_account");foreach ($withdraw_pending as $row2)echo $row2["withdraw_amount"]."";//$pending_amount=$row2["withdraw_amount"];//$total_pending+=$pending_amount;-----------------------------------------------SQL statement Where Clause && syntax :$this->common->updateRecord("tbl_ewallet",$up_data1, "customerid = '" . $user_id_arr . "' AND id = '" . $bonus_id_arr . "'");--------------------------------------------If purchase package on sat, then wont get % jumping and profit on Tues, only will get them on Wednesday :using mysql WHERE .... AND ((DAYOFWEEK(created_on) IN(0,1,2,3,4,6)) OR (DAYOFWEEK(created_on) = 5 AND DAYOFWEEK('".CURRENTDATE."') = 1 AND DATEDIFF('".CURRENTDATE."',created_on) >= 4) OR (DAYOFWEEK(created_on) = 5 AND DAYOFWEEK('".CURRENTDATE."') IN(0,2,3,4,5,6)))ORDER BY created_on ASC;");or using php$purchase_day = date('D', strtotime($created_on));$today_date = date('Y-m-d', time());$diff_day = date_diff(new DateTime($today_date),new DateTime($created_on));//echo $diff_day->format("%a"); //haha//if($diff_day->format("%a") > 60){ echo "yes"; }else{echo "No";}//echo $purchase_day;if ($purchase_day == "Sat" && date("l") == "Tuesday" && $diff_day->format("%a") < 7 ){$created_on = 0;-------------------------ajax call php function :Search "drawCallBack" on page (inside ajax there). Paste the following code under this line ://page loaded immediately check if 1st flamingo package auto renew is yes or no, then update all top up package auto renew in databasevar arTp = $('.artp');var arTpArray=[];for(var i=0; i----------------------------------------------Array with key and value :if got bug then might be because u didn't declare $temp_paid_breakaway_bonus_ref = array(); at the first function index()$member_got_bonus_already=array(); //declare at function index()global $member_got_bonus_already; //declare at function printList()//deduct previous already paid out star bonusif (@array_key_exists($userid, $member_got_bonus_already)) //retrive value from array{ //check array if this member already get bonus previously$individul_paid_bonus_rate = explode("#",$member_got_bonus_already[$userid]);foreach($individul_paid_bonus_rate as $i_p_b_r) {$final_star_bonus_rate = $final_star_bonus_rate - $i_p_b_r;$star_bonus_receive = $individu_total_package_size * $final_star_bonus_rate / 100;}else{//insert value into array sample 1 :if($star_bonus_receive != "" || $star_bonus_receive != 0)if (@array_key_exists($userid, $member_got_bonus_already)) //userid 123 => bonus 15# bonus 200 # bonus 39$member_got_bonus_already[$userid] = $member_got_bonus_already[$userid] . "#" . $final_star_bonus_rate;}else{$member_got_bonus_already[$userid] = $final_star_bonus_rate; //save member_id and bonus_rate into array, so later his upline will deduct bonus_rate from this array.this array.//insert value into array sample 2 :foreach($single_package_id as $package_id)if($package_id != 0)if (isset($package_id) AND isset($temp_paid_star_bonus_package) AND array_key_exists($package_id,$temp_paid_star_bonus_package))$temp_paid_star_bonus_package[$package_id] = $temp_paid_star_bonus_package[$package_id] + $final_star_bonus_rate;}else{$temp_paid_star_bonus_package[$package_id] = $final_star_bonus_rate ;//if want to retrive both keyand valueforeach ($member_got_bonus_already as $key => $value )echo $key;echo $value;--------------------------------------------------NOT Exist mysql query :$user_tree = $this->getAllRec("u.user_id,(SELECT COUNT(o.user_id) FROM tbl_user_master o WHERE o.sponsor_id = u.user_id AND o.user_type = 2 AND o.status = 1 AND NOT EXISTS (SELECT p.user_idFROM tbl_flamingo_product_order pWHERE (p.user_id = u.user_id OR p.user_id = o.user_id) AND p.status=3)) AS ChildCnt","tbl_user_master u","WHERE u.sponsor_id = '".$user_id."' AND u.user_type = 2 AND u.status =1 AND NOT EXISTS (SELECT p.user_idFROM tbl_flamingo_product_order pWHERE p.user_id = u.user_id AND p.status=3)");Becareful, if upline is not exist in other table, then won't show this uplines, so will causing bug not showing all downlines of this upline. (missing downlines bug)--------------------------------------------------NOT Exist mysql query WHERE id in array ()$data['member'] = $member = $this->common->getAllRec("o.user_id,o.username,o.first_name, o.last_name","tbl_user_master o","WHERE o.user_id IN (".$my_tree_ids.") and o.status != 3 AND o.user_type = 2AND NOT EXISTS (SELECT p.user_idFROM tbl_flamingo_product_order pWHERE p.user_id = o.user_id AND p.status=3)ORDER BY o.first_name ASC, o.last_name ASC");----------------------------------------------------Return string that extended by recursive loop :Live demo at lifestartoday.com>library>common.php>loop_get_three_uplines()Simple Live demo 2 at generate_user_unique_code() function at common.php fileMethod 1 : Pass variable in function argument :function test_loop($x_values,$x, $y)$x = $x + 1;if($x < 10)$x_values[] = $x."#"; // insert item 2#,3#,4# into array//loop again if y is not = 3;$y = $y + 1;if($y < 5)return $x_values = test_loop($x_values, $x, $y); // need to put two return. 1 at recall loop function, another 1 at else statement}else{echo "gula"; //need to put the echo at else statementreturn $x_values;function abc(){$bababa = test_loop([],1,0);foreach($bababa as $fpackage_id)echo $fpackage_id;abc();---------------------------------------------------Method 2 : declare variable by staticfunction test_loop($x, $y)static $x_values = array();$x = $x + 1;if($x < 10)$x_values[] = $x."#"; // insert item 2#,3#,4# into array//loop again if y is not = 3;$y = $y + 1;if($y < 5)return test_loop($x, $y); // need to put two return. 1 at recall loop function, another 1 at else statement}else{echo "gula"; //need to put the echo at else statementreturn $x_values;function abc(){$bababa = test_loop(1,0);foreach($bababa as $fpackage_id)echo $fpackage_id;abc();-------------------------------------------------Split a big functions into many small functions and pass value by many array from Controllers to Views sample at :1) https://stackoverflow.com/questions/61550787/how-to-insert-key-and-value-of-an-array-into-another-array-key 2) https://stackoverflow.com/questions/61548454/how-to-pass-array-multiple-array-key-and-value-from-controllers-to-views-in-code