$c = 0;
    // echo "male selected brands are : <br>";
    add_brfnotexist(get_oldb_slcted(), get_brand_names(brands_men_list(), $selected_brand));
    // echo "<br><br><br>";
    del_brfunchecked(brands_men_list(), $selected_brand);
    // if ( strlen($selected_brand) > 0 ) {
    // 	$brandname=get_brand_names(brands_men_list(),$selected_brand);
    // 	for ($i=0; $i < count($brandname) ; $i++) {
    // 		$c+=1;
    // 		echo " $c .)".$brandname[$i]."<br>";
    // 	}
    // }
} else {
    $c = 0;
    // echo "female selected brands are : <br>";
    add_brfnotexist(get_oldb_slcted(), get_brand_names(brands_women_list(), $selected_brand));
    // echo "<hr>";
    del_brfunchecked(brands_women_list(), $selected_brand);
    // if ( strlen($selected_brand) > 0 ) {
    // 	$brandname=get_brand_names(brands_women_list(),$selected_brand);
    // 	for ($i=0; $i < count($brandname) ; $i++) {
    // 		 $c+=1;
    // 		 echo " $c .)".$brandname[$i]."<br>";
    // 	}
    // }
}
?>

<?php 
// echo "hello there!";
$mybrand_indb = select('fs_member_brand_selected', 4, array('mno', $_SESSION['mno']));
Exemple #2
0
function del_brfunchecked($brands_list, $selected_brand)
{
    $get_brand_names = get_brand_names($brands_list, $selected_brand);
    // $selected_brand=br_convert_array($selected_brand);
    $get_oldb_slcted = get_oldb_slcted();
    // print_r( $selected_brand);
    // print_r($get_brand_names);
    // brand_index($bname)
    $delete = true;
    for ($i = 0; $i < count($get_oldb_slcted); $i++) {
        for ($j = 0; $j < count($get_brand_names); $j++) {
            if (is_equal($get_oldb_slcted[$i][2], brand_index($get_brand_names[$j]))) {
                // echo $get_oldb_slcted[$i][2]." == ".$get_brand_names[$j]."<br>";
                $delete = false;
            }
        }
        if ($delete) {
            // echo "unchecked and delete ".$get_oldb_slcted[$i][2]." from database <br>";
            delete_w_2('fs_member_brand_selected', array('mno', $_SESSION['mno'], 'bn', $get_oldb_slcted[$i][2]), 'and');
            // delete_w_2($table_name,$where_array,$oparators)
        } else {
            // echo "checked and not delete ".$get_oldb_slcted[$i][2]." from database <br>";
            $delete = true;
        }
    }
}