예제 #1
0
파일: DB.php 프로젝트: sandeepsis/nuwax
        $general->redirectUrl($url, $num);
        exit;
    } else {
        $pattern = '/^[0-9]+$/';
        if (preg_match($pattern, trim($_REQUEST['contactno'])) == '0') {
            $_SESSION['msg'] = 'Please enter valid seller / purchaser contact no';
            $num = 'danger';
            $num .= '&id=' . $_REQUEST['id'];
            $url = ADMIN_URL . "/purchaseorders/edit.php";
            $general->redirectUrl($url, $num);
            exit;
        }
    }
    $fieldvalues = array("name" => $_REQUEST['name'], "emailaddress" => $_REQUEST['emailaddress'], "contactno" => $_REQUEST['contactno'], "remark" => $_REQUEST['remark']);
    $cond = array("id" => $_REQUEST['id']);
    $updated = $Purchaseorder->updatePurchaseorder($fieldvalues, $cond);
    if ($updated) {
        $general->addLogAction($_SESSION['adm_user_id'], 'Edited', $_REQUEST['id'], 'Purchase order', $_SESSION['adm_status']);
        $error = 'success';
        $_SESSION['msg'] = 'Record updated successfully.';
    } else {
        $error = 'danger';
        $_SESSION['msg'] = 'Error updating record.';
    }
    $url = ADMIN_URL . "/purchaseorders/index.php";
    $general->redirectUrl($url, $error);
    exit;
}
/*************************************************************************************/
if (isset($_REQUEST['FLAG']) && $_REQUEST['FLAG'] == 'DELETE') {
    $id = $_REQUEST['id'];