function set_notifyme() { if (!($res = select_w_2('notifyme', 4, array('mno', $_SESSION['mno'], 'plno', $_GET['plno']), 'and'))) { insert('notifyme', array('mno', 'plno', 'nsdate'), array($_SESSION['mno'], $_GET['plno'], ''), 'nno'); } else { $del = delete_w_2('notifyme', array('mno', $_SESSION['mno'], 'plno', $_GET['plno']), 'and'); } if (!$res) { echo "inserted"; } if ($del) { echo "deleted"; } }
function like_dislike() { if (!empty($_SESSION['mno'])) { if (empty($_GET['unlike'])) { if (!select_w_2('posted_looks_comments_like_dislike', 1, array('plcno', $_GET['comment_id'], 'mno', $_SESSION['mno']), 'and')) { insert('posted_looks_comments_like_dislike', array('plcno', 'mno'), array($_GET['comment_id'], $_SESSION['mno']), 'plcldno'); $total_like = select('posted_looks_comments_like_dislike', 3, array('plcno', $_GET['comment_id'])); count_total_like($total_like); // echo "Sucesfully like the comment "; } else { $total_like = select('posted_looks_comments_like_dislike', 3, array('plcno', $_GET['comment_id'])); count_total_like($total_like); } } else { delete_w_2('posted_looks_comments_like_dislike', array('plcno', $_GET['unlike'], 'mno', $_SESSION['mno']), 'and'); // echo "Sucesfully unlike the comment"; $total_like = select('posted_looks_comments_like_dislike', 3, array('plcno', $_GET['unlike'])); count_total_like($total_like); } } }
function delete_from_activity_action_posted($plno) { if (delete_w_2('activity', array('_table_id', $plno, 'action', 'Posted'), 'and')) { // echo " <br>from activity action posted succesfully deleted! <br>"; } else { // echo "<br>failled to delete from activity action posted!"; } }
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; } } }