connect(); if(isset($_POST['category_id'])) { $category_id = trim(strtolower($_POST['category_id'])); $selected_subcate_id = trim(strtolower($_POST['selected_subcate_id'])); $yuuyuy = ""; $db->select('sub_category','*',NULL,"cat_id = '$category_id'"); $resultsd = $db->getResult(); foreach($resultsd as $rrr) { $ioiooo = $rrr['name']; $ididi = $rrr['id']; if($selected_subcate_id == $ididi) { $yuuyuy .= ""; } else { $yuuyuy .= ""; } } print $yuuyuy; } if(isset($_POST['prd_cate_id'])) { $category_id = trim(strtolower($_POST['prd_cate_id'])); $sub_cat_id = trim(strtolower($_POST['sub_cat_id'])); $selected_product_id = trim(strtolower($_POST['selected_product_id'])); $yuuyuy = ""; $db->select('item','*',NULL,"cat_id = '$category_id' and sub_cat_id = '$sub_cat_id' "); $resultsd = $db->getResult(); foreach($resultsd as $rrr) { $ioiooo = $rrr['item_code']." - ".$rrr['title']; $ididi = $rrr['id']; if($selected_product_id == $ididi) { $yuuyuy .= ""; } else { $yuuyuy .= ""; } } print $yuuyuy; } if(isset($_POST['homePrdId'])) { $item_id = trim(strtolower($_POST['homePrdId'])); $homeset = trim(strtolower($_POST['homeSet'])); $updval = array('featured' => $homeset); $db->update('item',$updval,"id = '$item_id'"); } if(isset($_POST['homeOfferId'])) { $item_id = trim(strtolower($_POST['homeOfferId'])); $homeset = trim(strtolower($_POST['homeSet'])); $updval = array('offer' => $homeset); $db->update('item',$updval,"id = '$item_id'"); } if(isset($_POST['homeWeddingId'])) { $item_id = trim(strtolower($_POST['homeWeddingId'])); $homeset = trim(strtolower($_POST['homeSet'])); $updval = array('wedding' => $homeset); $db->update('item',$updval,"id = '$item_id'"); } if(isset($_POST['search_section_id'])) { $search_section_id = trim(strtolower($_POST['search_section_id'])); $yuuyuy = ""; $query = mysql_query("select * from item_category where section_id = '$search_section_id' "); while($rrr = mysql_fetch_array($query)) { $ioiooo = $rrr['cat_name']; $ididi = $rrr['id']; $yuuyuy .= ""; } print $yuuyuy; } if(isset($_POST['upd_item_price'])) { $price = trim(strtolower($_POST['upd_item_price'])); $item_id = trim(strtolower($_POST['item_id'])); mysql_query("update item_price set price = '$price' where id = '$item_id' and mode = 1 "); } if(isset($_POST['sect_id'])) { $section_id = trim(strtolower($_POST['sect_id'])); $cate_id = trim(strtolower($_POST['cate_id'])); $selected_cate_id = ''; if($cate_id == 0) $dfgdfgdfgdf = " "; else $dfgdfgdfgdf = " and cat_id = '$cate_id'"; $yuuyuy = ""; $query = mysql_query("select * from item_sub_category where section_id = '$section_id' $dfgdfgdfgdf and status = 1 "); while($rrr = mysql_fetch_array($query)) { $ioiooo = $rrr['sub_cat_name']; $ididi = $rrr['id']; if($selected_cate_id == $ididi) { $yuuyuy .= ""; } else { $yuuyuy .= ""; } } print $yuuyuy; } if(isset($_POST['itemCategoryId']) or isset($_POST['itemSectionId'])) { $section_id = trim(strtolower($_POST['itemSectionId'])); $cate_id = trim(strtolower($_POST['itemCategoryId'])); $query = mysql_query("select * from item_sub_category where section_id = '$section_id' and cat_id = '$cate_id' and status = 1 "); $num = mysql_num_rows($query); if($num > 0) $yuuyuy = ""; else $yuuyuy = 59595; while($rrr = mysql_fetch_array($query)) { $ioiooo = $rrr['sub_cat_name']; $ididi = $rrr['id']; if($selected_cate_id == $ididi) { $yuuyuy .= ""; } else { $yuuyuy .= ""; } } print $yuuyuy; } if(isset($_POST['sub_category_id'])) { $sub_category_id = trim(strtolower($_POST['sub_category_id'])); $section_id = trim(strtolower($_POST['sectn_id'])); $category_id = trim(strtolower($_POST['category_id'])); $yuuyuy = ""; $query = mysql_query("select * from item where section_id = '$section_id' and cat_id = '$category_id' and sub_cate_id = '$sub_category_id' and status = 1 "); while($rrr = mysql_fetch_array($query)) { $ioiooo = $rrr['item_name']; $ididi = $rrr['id']; $yuuyuy .= ""; } print $yuuyuy; } if(isset($_POST['sysweighttype'])) { $yuuyuy = ""; $query = mysql_query("select * from weight_type "); while($rrr = mysql_fetch_array($query)) { $ioiooo = $rrr['weight_name']; $ididi = $rrr['id']; $yuuyuy .= ""; } print $yuuyuy; } if(isset($_POST['totaldfitemrows'])) { $item_idp = $_POST['item_id']; $date = date('Y-m-d'); $time = date('H:i:s'); $rate = $_POST['itrate']; $itwettype = $_POST['itwettype']; $itweight = $_POST['itweight']; $marketrate = $_POST['itemmarketrate']; if($itwettype == 1 or $itwettype == 2) $itweight = $itweight*1000; mysql_query("update item_price set mode = 0 where item_id = '$item_idp' and weight_type = '$itwettype' , weight = '$itweight' "); mysql_query("insert into item_price (item_id , weight_type , weight , price , market_price , time , date , mode) values ('$item_idp' , '$itwettype' , '$itweight' , '$rate' , '$marketrate' , '$time' , '$date' , 1) "); print "Success : Item Price successfully updated !"; } if(isset($_POST['caddress'])) { $caddress = trim(strtolower($_POST['caddress'])); $caddress = mysql_escape_string($caddress); $subcategoryQuery = mysql_query("select * from customer where address like '%$caddress%' order by id DESC limit 1 "); $num = mysql_num_rows($subcategoryQuery); if($num > 0) { while($st_row=mysql_fetch_array($subcategoryQuery)) { $address = $st_row['address']; } } else { $address = ''; } print $address; } if(isset($_POST['catrgory_id'])) { $catrgory_id = trim(strtolower($_POST['catrgory_id'])); $st_result=mysql_query("SELECT * FROM item where cat_id = '$catrgory_id' "); $yuuyuy = ""; $num = mysql_num_rows($st_result); if($num > 0) { while($st_row=mysql_fetch_array($st_result)) { $item_name = $st_row['item_name']; $ididi = $st_row['id']; $yuuyuy .= ""; } } print $yuuyuy; } if(isset($_POST['sal_month'])) { $sal_month = $_POST['sal_month']; $sal_emp_id = $_POST['sal_emp_id']; $grosssalary = 0; $query = mysql_query("select * from salary where emp_id = '$sal_emp_id' "); while($con_row=mysql_fetch_array($query)) { $basic_salary = $con_row['basic_salary']; $hra = $con_row['hra']; $da = $con_row['da']; $ta = $con_row['ta']; $grosssalary = $basic_salary+$hra+$da+$ta; } print $grosssalary; } if(isset($_POST['leavesal_month'])) { $sal_month = $_POST['leavesal_month']; $sal_emp_id = $_POST['sal_emp_id']; $deduc = 0; if($sal_month > '') { $fdfdf = explode('/',$sal_month); $sdate = $fdfdf[1]."-".$fdfdf[0]."-01"; $edate = $fdfdf[1]."-".$fdfdf[0]."-31"; $leavepermonth = 0; $leavededuction = 0; $query = mysql_query("select * from salary where emp_id = '$sal_emp_id' "); while($con_row=mysql_fetch_array($query)) { $leavepermonth = $con_row['leavepermonth']; $leavededuction = $con_row['leavededuction']; } $query = mysql_query("select * from staff_attendance where emp_id = '$sal_emp_id' and (date BETWEEN '$sdate' AND '$edate') "); $num = mysql_num_rows($query); if($num > $leavepermonth) { $deduc = ($num-$leavepermonth)*$leavededuction; } else $deduc = 0; } print $deduc; } if(isset($_POST['netsal_month'])) { $sal_month = $_POST['netsal_month']; $sal_emp_id = $_POST['sal_emp_id']; $deduc = 0; if($sal_month > '') { $fdfdf = explode('/',$sal_month); $sdate = $fdfdf[1]."-".$fdfdf[0]."-01"; $edate = $fdfdf[1]."-".$fdfdf[0]."-31"; $leavepermonth = 0; $leavededuction = 0; $basic_salary = 0; $hra = 0; $da = 0; $ta = 0; $query = mysql_query("select * from salary where emp_id = '$sal_emp_id' "); while($con_row=mysql_fetch_array($query)) { $leavepermonth = $con_row['leavepermonth']; $leavededuction = $con_row['leavededuction']; } $query = mysql_query("select * from salary where emp_id = '$sal_emp_id' "); while($con_row=mysql_fetch_array($query)) { $basic_salary = $con_row['basic_salary']; $hra = $con_row['hra']; $da = $con_row['da']; $ta = $con_row['ta']; } $grosssalary = $basic_salary+$hra+$da+$ta; $query = mysql_query("select * from staff_attendance where emp_id = '$sal_emp_id' and (date BETWEEN '$sdate' AND '$edate') "); $num = mysql_num_rows($query); if($num > $leavepermonth) { $deduc = $grosssalary-(($num-$leavepermonth)*$leavededuction); } else $deduc = $grosssalary; } print $deduc; } if(isset($_POST['newCapcha'])) { function randomPrefix($length) { $random= ""; srand((double)microtime()*1000000); $data = "AbcDE123IJKLMN67QRSTUVWXYZ"; $data .= "aBCdefghijklmn123opq45rs67tuv89wxyz"; $data .= "0FGH45OP89"; for($i = 0; $i < $length; $i++) { $random .= substr($data, (rand()%(strlen($data))), 1); } return $random; } $_SESSION['capchaverification'] = randomPrefix(7); } if(isset($_POST['srno'])) { $srno = trim(strtolower($_POST['srno'])); $query = mysql_query("select * from student_reg where srno = '$srno' "); $num = mysql_num_rows($query); print $num; } if(isset($_POST['account_access_reght'])) { $account_access_reght = trim(strtolower($_POST['account_access_reght'])); $ischecked = trim(strtolower($_POST['ischecked'])); mysql_query("update accountant_menu set mode = '$ischecked' where id = '$account_access_reght' "); $ttttt = mysql_query("select * from accountant_menu where id = '$account_access_reght' "); while($hjjh = mysql_fetch_array($ttttt)) { $ffparent_menu = $hjjh['parent_menu']; } $rewrewr = mysql_query("select * from accountant_menu where parent_menu = '$ffparent_menu' and mode = 1 "); $numss = mysql_num_rows($rewrewr); if($numss == 0) { mysql_query("update accountant_menu set mode = 0 where id = '$ffparent_menu' "); $hhgk = 0; print $ffparent_menu."#".$hhgk; } else { mysql_query("update accountant_menu set mode = 1 where id = '$ffparent_menu' "); $hhgk = 1; print $ffparent_menu."#".$hhgk; } } if(isset($_POST['account_access_reght_main'])) { $account_access_reght_main = trim(strtolower($_POST['account_access_reght_main'])); $ischecked = trim(strtolower($_POST['ischecked'])); mysql_query("update accountant_menu set mode = '$ischecked' where id = '$account_access_reght_main' "); mysql_query("update accountant_menu set mode = '$ischecked' where parent_menu = '$account_access_reght_main' "); } if(isset($_POST['staff_access_reght'])) { $staff_access_reght = trim(strtolower($_POST['staff_access_reght'])); $ischecked = trim(strtolower($_POST['ischecked'])); mysql_query("update staff_menu set mode = '$ischecked' where id = '$staff_access_reght' "); $ttttt = mysql_query("select * from staff_menu where id = '$staff_access_reght' "); while($hjjh = mysql_fetch_array($ttttt)) { $ffparent_menu = $hjjh['parent_menu']; } $rewrewr = mysql_query("select * from staff_menu where parent_menu = '$ffparent_menu' and mode = 1 "); $numss = mysql_num_rows($rewrewr); if($numss == 0) { mysql_query("update staff_menu set mode = 0 where id = '$ffparent_menu' "); $hhgk = 0; print $ffparent_menu."#".$hhgk; } else { mysql_query("update staff_menu set mode = 1 where id = '$ffparent_menu' "); $hhgk = 1; print $ffparent_menu."#".$hhgk; } } if(isset($_POST['staff_access_reght_main'])) { $staff_access_reght_main = trim(strtolower($_POST['staff_access_reght_main'])); $ischecked = trim(strtolower($_POST['ischecked'])); mysql_query("update staff_menu set mode = '$ischecked' where id = '$staff_access_reght_main' "); mysql_query("update staff_menu set mode = '$ischecked' where parent_menu = '$staff_access_reght_main' "); } if(isset($_POST['card_no'])) { $res = ''; $card_no = trim(strtolower($_POST['card_no'])); $query = mysql_query("select * from customer where card_number = '$card_no' "); $numss = mysql_num_rows($query); if($numss == 0) { $res = '.'; } else { while($result = mysql_fetch_array($query)) { $res = $result['mobile_shop']; } } print $res; } if(isset($_POST['card_no_name'])) { $res = ''; $card_no_name = trim(strtolower($_POST['card_no_name'])); $query = mysql_query("select * from customer where id = '$card_no_name' "); $numss = mysql_num_rows($query); if($numss == 0) { $res = '.'; } else { while($result = mysql_fetch_array($query)) { $res = $result['title']." ".$result['name']; } } print $res; } if(isset($_POST['card_no_mobil_id'])) { $res = ''; $card_no_name = trim(strtolower($_POST['card_no_mobil_id'])); $query = mysql_query("select * from customer where id = '$card_no_name' "); $numss = mysql_num_rows($query); if($numss == 0) { $res = '.'; } else { while($result = mysql_fetch_array($query)) { $res = $result['mobile_office']; } } print $res; } if(isset($_POST['card_no_add'])) { $res = ''; $card_no_add = trim(strtolower($_POST['card_no_add'])); $query = mysql_query("select * from customer where id = '$card_no_add' "); $numss = mysql_num_rows($query); if($numss == 0) { $res = '.'; } else { while($result = mysql_fetch_array($query)) { $res = $result['address']; } } print $res; } if(isset($_POST['customerCardInfo'])) { $res = ''; $card_no_add = trim(strtolower($_POST['customerCardInfo'])); $query = mysql_query("select * from customer where id = '$card_no_add' "); $numss = mysql_num_rows($query); if($numss == 0) { $res = '.'; } else { while($result = mysql_fetch_array($query)) { $res = $result['card_number']; } } print $res; } if(isset($_POST['quantity'])) { extract($_POST); if($wettype == 1 or $wettype == 2) { $quantity = $quantity*1000; } $totamnt = (($quantity/1000)*$item_rate)+$brockrage; print round($totamnt,2); } if(isset($_POST['net_weight'])) { extract($_POST); $price = 0; if($net_weight_type == 2 or $net_weight_type == 4) { $net_weight = $net_weight*1000; } $que = mysql_query("SELECT * FROM item_price where weight_type = '$net_weight_type' and item_id = '$item_id' and weight <= '$net_weight' and mode = 1 order by weight DESC limit 1 "); $num = mysql_num_rows($que); if($num == 0) { $que = mysql_query("SELECT * FROM item_price where weight_type = '$net_weight_type' and item_id = '$item_id' and weight > '$net_weight' and mode = 1 order by weight ASC limit 1 "); } while($rrr = mysql_fetch_array($que)) { $price = $rrr['price']; $item_weight_type = $rrr['weight_type']; $item_weight = $rrr['weight']; } $totalamnt = ($price/$item_weight)*$net_weight; print $totalamnt; } if(isset($_POST['net_weight_rate'])) { extract($_POST); $price = 0; if($net_weight_type == 2 or $net_weight_type == 4) { $net_weight_rate = $net_weight_rate*1000; } $que = mysql_query("SELECT * FROM item_price where item_cat_id = '$cat_id' and item_id = '$item_id' and weight <= '$net_weight_rate' and mode = 1 order by weight DESC limit 1 "); $num = mysql_num_rows($que); if($num == 0) { $que = mysql_query("SELECT * FROM item_price where item_cat_id = '$cat_id' and item_id = '$item_id' and weight > '$net_weight_rate' and mode = 1 order by weight ASC limit 1 "); } while($rrr = mysql_fetch_array($que)) { $price = $rrr['price']; $item_weight_type = $rrr['weight_type']; $item_weight = $rrr['weight']; } $query = mysql_query("SELECT * FROM weight_type where id = '$item_weight_type' "); while($rrr = mysql_fetch_array($query)) { $weight_type_name = $rrr['weight_name']; } if($item_weight_type == 2 or $item_weight_type == 4) { $netwt = $item_weight/1000; } else { $netwt = $item_weight; } $totalamnt = $price."#".$netwt." ".$weight_type_name; print $totalamnt; } if(isset($_POST['des_net_weight'])) { extract($_POST); $totalamnt = 0; $totalamnt = round((($itm_rate/$rate_weight)*$des_net_weight),2); print $totalamnt; } if(isset($_POST['discount_coupon_id'])) { extract($_POST); if($discount_coupon_id == '') { $res = $grandtotalamnt; } else { $query = mysql_query("SELECT * FROM coupon where id = '$discount_coupon_id'"); while($row = mysql_fetch_array($query)) { $discount = $row['discount']; $dis_type = $row['dis_type']; } if($dis_type == 1) { $res = $grandtotalamnt-$discount; } else { $dist = $grandtotalamnt-(($discount/100)*$grandtotalamnt); $res = round($dist,2); } } print $res; } if(isset($_POST['mebrList'])) { $res = ''; $mebrList = trim(strtolower($_POST['mebrList'])); $query = mysql_query("select * from customer where name like '%$mebrList%' "); $numss = mysql_num_rows($query); if($numss > 0) { $i = 1; while($result = mysql_fetch_array($query)) { $name = $result['name']; $card_number = $result['card_number']; if($i == $numss) $res .= "'".$name."'"; else $res .= "'".$name."',"; $i++; } } print $res; } if(isset($_POST['no_avaiable_item'])) { $item_id = trim(strtolower($_POST['no_avaiable_item'])); $table_id = trim(strtolower($_POST['no_avaiable_table_id'])); mysql_query("update order_details set mode = 4 where mode = 1 and id = '$table_id' and item_id = '$item_id' "); } if(isset($_POST['yes_avaiable_item'])) { $item_id = trim(strtolower($_POST['yes_avaiable_item'])); $table_id = trim(strtolower($_POST['yes_avaiable_table_id'])); mysql_query("update order_details set mode = 1 where mode = 4 and id = '$table_id' and item_id = '$item_id' "); } if(isset($_POST['grtotalamntfordisAmntLeft'])) { $totalamnt = trim(strtolower($_POST['grtotalamntfordisAmntLeft'])); $table_amnt = trim(strtolower($_POST['items_amnt'])); $totalamnt = $totalamnt-$table_amnt; print $totalamnt; } if(isset($_POST['grtotalamntAmntLeft'])) { $totalamnt = trim(strtolower($_POST['grtotalamntAmntLeft'])); $table_amnt = trim(strtolower($_POST['items_amnt'])); $totalamnt = $totalamnt-$table_amnt; print $totalamnt; } if(isset($_POST['grtotalamntfordisAmnt'])) { $totalamnt = trim(strtolower($_POST['grtotalamntfordisAmnt'])); $table_amnt = trim(strtolower($_POST['items_amnt'])); $totalamnt = $totalamnt+$table_amnt; print $totalamnt; } if(isset($_POST['grtotalamntAmnt'])) { $totalamnt = trim(strtolower($_POST['grtotalamntAmnt'])); $table_amnt = trim(strtolower($_POST['items_amnt'])); $totalamnt = $totalamnt+$table_amnt; print $totalamnt; } if(isset($_POST['returnItemIdYes'])) { $item_table_id = trim(strtolower($_POST['returnItemIdYes'])); $quer = mysql_query("SELECT * FROM order_details where id = '$item_table_id' "); while($row = mysql_fetch_array($quer)) { $order_id = $row['order_id']; $customer_id = $row['customer_id']; $net_cancel_price = $row['net_price']; } mysql_query("update order_details set mode = 5 where id = '$item_table_id' and order_id = '$order_id' "); mysql_query("insert into return_item (order_id , order_detail_id , amount) values ('$order_id' , '$item_table_id' , '$net_cancel_price') "); $quer = mysql_query("SELECT SUM(amount) FROM return_item where order_id = '$order_id' and order_detail_id = '$item_table_id' "); while($row = mysql_fetch_array($quer)) { $total_return_amount = $row[0]; } $query = mysql_query("SELECT * FROM customer_order where id = '$order_id' "); while($rrr = mysql_fetch_array($query)) { $coupon_discount = $rrr['coupon_discount']; } $quer = mysql_query("SELECT * FROM order_details where order_id = '$order_id' and mode = 0 "); $totitm = mysql_num_rows($quer); if($totitm == 0) $total_return_amount = $total_return_amount-$coupon_discount; mysql_query("update customer_order set return_amount = '$total_return_amount' where id = '$order_id' "); mysql_query("update payment set returns = '$total_return_amount' where order_id = '$order_id' "); $grndtatl_amnt = 0; $quer = mysql_query("SELECT SUM(net_price) FROM order_details where (mode = 0 or mode = 4) and order_id = '$order_id' "); while($row = mysql_fetch_array($quer)) { $grndtatl_amnt = $row[0]; } if($grndtatl_amnt == 0) $dfghjklfghj = 0; else $dfghjklfghj = $grndtatl_amnt-$coupon_discount; print $dfghjklfghj; } if(isset($_POST['returnItemIdNot'])) { $item_table_id = trim(strtolower($_POST['returnItemIdNot'])); $quer = mysql_query("SELECT * FROM order_details where id = '$item_table_id' "); while($row = mysql_fetch_array($quer)) { $order_id = $row['order_id']; } mysql_query("update order_details set mode = 0 where id = '$item_table_id' and order_id = '$order_id' "); mysql_query("DELETE FROM return_item where order_id = '$order_id' and order_detail_id = '$item_table_id' "); $quer = mysql_query("SELECT SUM(amount) FROM return_item where order_id = '$order_id' and order_detail_id = '$item_table_id' "); while($row = mysql_fetch_array($quer)) { $total_return_amount = $row[0]; } mysql_query("update customer_order set return_amount = '$total_return_amount' where id = '$order_id' "); $grndtatl_amnt = 0; $quer = mysql_query("SELECT SUM(net_price) FROM order_details where (mode = 0 or mode = 4) and order_id = '$order_id' "); while($row = mysql_fetch_array($quer)) { $grndtatl_amnt = $row[0]; } $query = mysql_query("SELECT * FROM customer_order where id = '$order_id' "); while($rrr = mysql_fetch_array($query)) { $coupon_discount = $rrr['coupon_discount']; } if($grndtatl_amnt == 0) $dfghjklfghj = 0; else $dfghjklfghj = $grndtatl_amnt-$coupon_discount; print $dfghjklfghj; } if(isset($_POST['homeSalePrdId'])) { $item_id = trim(strtolower($_POST['homeSalePrdId'])); $homeset = trim(strtolower($_POST['homeSet'])); $updval = array('offer' => $homeset); $db->update('item',$updval,"id = '$item_id'"); } mysql_close();