function UpdateCounterCache($department_id) { $sql = 'SELECT count(*) FROM USER WHERE user_department=' . $department_id; $count = parent::selectQuery($sql); $sql = "UPDATE departments \n\t\t\t\tSET department_user_count = {$count} \n\t\t\t\tWHERE department_id={$department_id}"; parent::updateQuery($sql); }
public function RetriveQuotationDetailsInfoByIndendId($quot_ms_id) { $sql = "SELECT qud.*, stki.stock_item_name \n \t\t\t\tFROM quotation_details qud, quotation_master qum, stock_item stki \n \t\t\t\tWHERE qud.quot_master_id='{$quot_ms_id}' \n \t\t\t\tAND stki.stock_item_id= qud.stock_item_id \n \t\t\t\tGROUP BY qud.stock_item_id "; return parent::selectQuery($sql); }
function updateSta_len($Sta_Lent_id, $Sta_Len_name) { $sql = "UPDATE staple_length SET sta_len_name='{$Sta_Len_name}' WHERE sta_len_id = '{$Sta_Lent_id}'"; return parent::selectQuery($sql); }
public function FindDetailsOfGatePass($id) { $sql = "\tSELECT cd.*,si.* ,gpm.*,cm.consumption_num,siu.* ,\n\t \t\t\tGROUP_CONCAT(scd.stock_code,' ') stock_code, \n\t\t\t\tGROUP_CONCAT(spd.stock_part,' ') stock_part \n\t\t\t\t\t\n\t\t\t\tFROM gate_pass_master gpm,gate_pass_details cd, \n\t\t\t\tstock_item si, stock_code_details scd, stock_part_details spd,consumptions_master cm,stock_item_units siu\n\t\t\t\tWHERE \n\t\t\t\t\tcd.stock_item_id = si.stock_item_id\n\t\t\t\tAND \n\t\t\t\t\tsi.stock_code_m_id = scd.stock_code_m_id \n\t\t\t\tAND\n\t\t\t\t\tcd.gate_pass_m_id=1\n\t\t\t\tAND\n\t\t\t\t\tsi.stock_part_m_id= spd.stock_part_m_id \n\t\t\t\tAND \n\t\t\t\t\tgpm.gate_pass_id = cd.gate_pass_m_id\n\t\t\t\tAND \n\t\t\t\t\tcm.cm_id = gpm.ref_id \n\t\t\t\tAND\n\t\t\t\t\tsi.stock_item_unit_id =siu.stock_item_unit_id\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t GROUP BY si.stock_item_id"; return parent::selectQuery($sql); }
public function PrintDetailsOfStockReturn($id) { $sql = "\tSELECT srd.*,si.* ,srm.*,siu.*, GROUP_CONCAT(scd.stock_code,' ') stock_code\n\t\t\t\tFROM \n\t\t\t\t\tstock_return_details srd,stock_return_master srm, stock_item si, \n\t\t\t\t\tstock_code_details scd, stock_item_units siu\n\t\t\t\tWHERE \n\t\t\t\t\tsrd.stock_item_id = si.stock_item_id\n\t\t\t\tAND \n\t\t\t\t\tsi.stock_code_m_id = scd.stock_code_m_id \n\t\t\t\tAND\n\t\t\t\t\tsrd.stk_return_m_id={$id}\n\t\t\t\tAND\n\t\t\t\t\tsi.stock_item_unit_id =siu.stock_item_unit_id \t\n\t\t\t\tAND\n\t\t\t\t\tsrm.stock_retun_m_id=srd.stk_return_m_id\n\t\t\t\t GROUP BY si.stock_item_id"; return parent::selectQuery($sql); }
public function PrintDetailsOfQC($id) { $sql = "\tSELECT qcd.*,si.* ,qcm.*, mrr.*,pr.* , sp.* \n\t\t\t\tFROM \n\t\t\t\t\tqc_details qcd,qc_master qcm, stock_item si, mrr_master mrr, \n\t\t\t\t\t purchase_master pr, supplier sp\n\t\t\t\tWHERE \n\t\t\t\t\tqcd.stock_item_id = si.stock_item_id\n\t\t\t\t\n\t\t\t\tAND\n\t\t\t\t\tqcd.qc_m_id={$id}\n\t\t\t\t\t\n\t\t\t\tAND\n\t\t\t\t\tqcm.qc_id=qcd.qc_m_id\n\t\t\t\tAND\n\t\t\t\t\tqcm.mrr_m_id=mrr.mrr_id \n\t\t\t\tAND\n\t\t\t\t\tqcm.purchase_m_id=pr.pm_id \n\t\t\t\t\n\t\t\t\tAND\n\t\t\t\t\tqcm.supplier_id=sp.sup_id\t\t\t\n\t\t\t\t\t\n\t\t\t\t GROUP BY si.stock_item_id"; return parent::selectQuery($sql); }
public function retriveMRRInfo() { $sql = "SELECT mrr_id ,mrr_number \n\t\t\t\tFROM mrr_master"; return parent::selectQuery($sql); }
function UpadteRawItemByID($stock_item_id, $stkName, $stkGrp, $unitId, $altUnitId, $unitRel1, $unitRel2, $length, $txtStkcode, $desc, $opQnty, $OpRate, $opValue) { $sql = "UPDATE raw_item \n\t\tSET stock_item_name='{$stkName}',\n\t\tstock_item_grp_id ='{$stkGrp}',\n\t\tstock_item_unit_id='{$unitId}',\n\t\t stock_alt_unit='{$altUnitId}',\n\t\t unit_relation1='{$unitRel1}',\n\t\t unit_relation2 ='{$unitRel2}',\n\t\t length='{$length}',\n\t\t stock_code_m_id='{$txtStkcode}',\n\t\t stock_item_desc ='{$desc}',\n\t\t stock_item_op_balance='{$opQnty}', \n\t\t stock_item_op_rate='{$OpRate}',\n\t\t stock_item_op_value='{$opValue}' \n\t\t WHERE stock_item_id='{$stock_item_id}'"; return parent::selectQuery($sql); }
public function FindDetailsOfConsumption($id) { $sql = "\tSELECT cd.*, si.*, cm.*, siu.* ,\n\t\t\t\t\tGROUP_CONCAT(scd.stock_code,' ') stock_code,\n\t\t\t\t\tGROUP_CONCAT(spd.stock_part,' ') stock_part \n\t\t\t\t\t\t\n\t\t\t\tFROM consumptions_master cm, consumption_details cd, stock_item si,stock_item_units siu,\n\t\t\t\t stock_code_details scd, stock_part_details spd\n\t\t\t\t\n\t\t\t\tWHERE \n\t\t\t\t\tcd.stock_item_id = si.stock_item_id\n\t\t\t\tAND \n\t\t\t\t\tsi.stock_code_m_id = scd.stock_code_m_id \n\t\t\t\tAND\n\t\t\t\t\tcd.consumptions_master_id={$id}\n\t\t\t\tAND\n\t\t\t\t\tsi.stock_part_m_id= spd.stock_part_m_id \n\t\t\t\tAND \n\t\t\t\t\tcd.consumptions_master_id =cm.cm_id\n\t\t\t\tAND\n\t\t\t\t\tsi.stock_item_unit_id =siu.stock_item_unit_id\n\t\t\t\t\t\n\t\t\t\t GROUP BY si.stock_item_id"; return parent::selectQuery($sql); }
public function PrintPurchaseOrderById($id) { $sql = "SELECT p_d.*,st.*,pm.*,im.indent_id, im.indent_code,\n\t\t\t\tsup.sup_id,\tsup.sup_name, sup.sup_address,\n\t\t\t\tsiu.stock_item_unit_id,\tsiu.stock_item_unit_name,\n\t\t\t\tGROUP_CONCAT(scd.stock_code,' ') stock_code, \n\t\t\t\tGROUP_CONCAT(spd.stock_part,' ') stock_part \n\t\tFROM \n\t\t\tpurchase_details p_d, stock_item st , purchase_master pm, supplier sup,\n\t\t\tstock_code_details scd, stock_part_details spd,indents_master im,stock_item_units siu\n\t\twhere \n\t\t\tp_d.pm_id='{$id}' \n\t\tAND\n\t\t\tp_d.pm_id=pm.pm_id\n\t\tAND \n\t\t\tim.indent_id=pm.indent_id\n\t\tAND\n\t\t\tsup.sup_id=pm.sup_id\n\t\tAND\n\t\t\tsiu.stock_item_unit_id=st.stock_item_unit_id\n\t\tAnd \n\t\t\tst.stock_item_id= p_d.stock_item_id\n\t\tAND \n\t\t\tst.stock_code_m_id = scd.stock_code_m_id \n\t\tAND\n\t\t\tst.stock_part_m_id= spd.stock_part_m_id\n\t\t\n\t\tGROUP BY st.stock_item_id \t\n\t\t "; return parent::selectQuery($sql); }
function GetSectionByID($id) { $sql = "SELECT usr_sec . * ,depmnt .* , ofic.* \n\t\t\t\t\tFROM user_section usr_sec, departments depmnt, offices ofic \t\n\t\t\t\t\tWHERE usr_sec.sec_id= '{$id}' \n\t\t\t\t\tAND usr_sec.dep_id=depmnt.department_id\t\n\t\t\t\t\tAND usr_sec.office_id=ofic.office_id "; return parent::selectQuery($sql); }
function updateCount($count_id, $count_name) { $sql = "UPDATE count SET count_name='{$count_name}' WHERE count_id = '{$count_id}'"; return parent::selectQuery($sql); }
function FindDetailsOfQoutation($id) { $sql = "SELECT qd.* , si.* \n\t\t\t\tFROM \n\t\t\t\t\tquotation_details qd,\n\t\t\t\t\tstock_item si \n\t\t\t\tWHERE \n\t\t\t\t\tqd.stock_item_id=si.stock_item_id \n\t\t\t\t\tAND qd.quot_master_id = {$id} \n\t\t\t\t\t"; //echo $sql; return parent::selectQuery($sql); }
public function retriveRawItemReport() { $sql = 'SELECT * FROM raw_item'; return parent::selectQuery($sql); }
function retriveStockCatUnderInfo() { $sql = "select stock_cat_name,stock_cat_id from stock_catagory "; return parent::selectQuery($sql); }
function CheckCreated() { $sql = "SELECT * FROM companies"; return parent::selectQuery($sql); }
public function PrintDetailsOfDelivery($id) { $sql = "\tSELECT dcd.*,dcm.*,si.* ,siu.stock_item_unit_id, siu.stock_item_unit_name, gpm.gate_pass_id,gpm.gate_pass_no, GROUP_CONCAT(scd.stock_code,' ') stock_code\n\t\t\t\tFROM \n\t\t\t\t\tdelivery_challan_details dcd, stock_item si, stock_code_details scd, \n\t\t\t\t\tgate_pass_master gpm, stock_item_units siu,delivery_challan_master dcm\n\t\t\t\tWHERE \n\t\t\t\t\tdcm.delivery_challan_id=dcd.delivery_challan_m_id\n\t\t\t\tAND\n\t\t\t\t\tdcd.stock_item_id = si.stock_item_id\n\t\t\t\tAND \n\t\t\t\t\tsi.stock_code_m_id = scd.stock_code_m_id \n\t\t\t\tAND\n\t\t\t\t\tdcd.delivery_challan_m_id={$id}\n\t\t\t\tAND\n\t\t\t\t\tdcd.gate_pass_no=gpm.gate_pass_id\t\n\t\t\t\tAND\n\t\t\t\t\tsi.stock_item_unit_id = siu.stock_item_unit_id\n\t\t\t\t GROUP BY si.stock_item_id\n\t\t\t\t"; return parent::selectQuery($sql); }
function updateImportGoods($imp_gds_id, $initial_offer_date, $pi_num, $pi_date, $factory_indent_num, $ic_num, $ic_date, $goods_shipment_date, $port_arrival_date, $goods_deliv_date, $factory_rec_date, $short_supply_claim_date, $short_supply_recive_date, $remark) { $sql = "UPDATE import_goods SET initial_offer_date='{$initial_offer_date}',pi_num='{$pi_num}',pi_date='{$pi_date}',\n\t\t\n\t\t\t\t\t\t\t\t\t\tfactory_indent_num='{$factory_indent_num}',ic_num='{$ic_num}',ic_date='{$ic_date}',\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tgoods_shipment_date='{$goods_shipment_date}',port_arrival_date='{$port_arrival_date}',\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tgoods_deliv_date='{$goods_deliv_date}',factory_rec_date='{$factory_rec_date}',\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tshort_supply_claim_date='{$short_supply_claim_date}',\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tshort_supply_recive_date='{$short_supply_recive_date}',\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tremark='{$remark}' WHERE id = '{$imp_gds_id}'"; return parent::selectQuery($sql); }
public function ReqByPower($user_level) { if ($user_level == 1) { $sql = "\tSELECT * \n\t\t\t\tFROM requisitions_master r_m, requisition_details r_d,stock_item s_i \n\t\t\t\tWHERE r_m.rm_id=r_d.requisition_master_id \n\t\t\t\tand r_d.stock_item_id=s_i.stock_item_id And r_m.status=1 "; } if ($user_level == 2) { $sql = "\tSELECT * \n\t\t\t\tFROM requisitions_master r_m, requisition_details r_d,stock_item s_i \n\t\t\t\tWHERE r_m.rm_id=r_d.requisition_master_id \n\t\t\t\tand r_d.stock_item_id=s_i.stock_item_id And r_m.status=2 "; } return parent::selectQuery($sql); }
public function userBelongsToDept($id) { $sql = "SELECT department_name FROM departments WHERE department_id=" . $id; return parent::selectQuery($sql); }
function updateLc($lc_id, $lc_name) { $sql = "UPDATE lc SET lc_name='{$lc_name}' WHERE lc_id = '{$lc_id}'"; return parent::selectQuery($sql); }
function updateSupplierCategory($sup_cat_id, $sup_cat_name, $sup_cat_parent_id) { $sql = "UPDATE tbl_supplier_cat SET supp_cat_name='{$sup_cat_name}',supp_cat_p_id ='{$sup_cat_parent_id}' WHERE supp_cat_id = '{$sup_cat_id}'"; return parent::selectQuery($sql); }
function retriveUserInfoByID($id) { $sql = "SELECT usr . * , usr_sec . * ,depmnt .* , ofic.* \n\t\t\t\tFROM users usr, user_section usr_sec, departments depmnt, offices ofic \n\t\t\t\tWHERE usr.user_id= '{$id}' \n\t\t\t\t\tAND usr.user_sec=usr_sec.sec_id \n\t\t\t\t\tAND usr.user_dept=depmnt.department_id \n\t\t\t\t\tAND usr.user_office=ofic.office_id "; return parent::selectQuery($sql); }
function updateOfficeGroup($officeID, $officeName, $address, $phone, $mail) { $sql = "UPDATE offices \n\t\tSET office_name='{$officeName}',office_address='{$address}',office_phone='{$phone}',office_mail='{$mail}' \n\t\tWHERE office_id = '{$officeID}'"; return parent::selectQuery($sql); }
function updateLot($lot_id, $lot_name) { $sql = "UPDATE lot SET lot_name='{$lot_name}' WHERE lot_id = '{$lot_id}'"; return parent::selectQuery($sql); }