<?php

include_once $CFG->dirroot . "/lib/classes/" . "application/State.Class.php5";
$StateObj = new State();
$GeneralObj->getRequestVars();
if ($mode == "Update") {
    $mystate = $StateObj->select($iStateId);
    $StateObj->getAllVar();
} else {
    $mode = "Add";
}
if ($file != '') {
    $link = "index.php?file=" . $file . "&mode=" . $mode . "&listfile=" . $listfile;
}
$section = 'State';
$TOP_HEADER = $mode . ' ' . $section;
?>
<form name="frmadd" method="post" action="index.php?file=t-state_masteradd_a" enctype="multipart/form-data" onSubmit="return validate_new(this);">
	<input type="hidden" name="mode" value="<?php 
echo $mode;
?>
">
	<input type="hidden" name="iStateId" value="<?php 
echo $iStateId;
?>
">
	<table width="97%" class="table-dottedborder" border="0" align="center" cellpadding="2" cellspacing="1">
		<tr>
			<td height="28">
				<h1>
					<?php 
Ejemplo n.º 2
0
$Data['vCountryCode'] = $cntcode[0]['vCountryCode'];
/** This is for Check Duplicate Record-------------------------------------------*/
$generalobj->getRequestVars();
$redirect_file = "index.php?file={$file}&view={$view}&iStateId={$iStateId}";
$generalobj->checkDuplicate('iStateId', PRJ_DB_PREFIX . "_state_master", array('vState' => $Data['vState']), $redirect_file, STATE_ALREADY_EXISTS, $iStateId);
if ($view == "add") {
    //prints($Data);exit;
    $stateObj->setAllVar($Data);
    $id = $stateObj->insert();
    if ($id) {
        $var_msg = "Record Added Successfully.";
    } else {
        $var_msg = "Eror-in Add.";
    }
} else {
    if ($view == "edit") {
        //prints($Data);exit;
        $arr = $stateObj->select($iStateId);
        $stateObj->setAllVar($arr);
        $stateObj->setAllVar($Data);
        $where = " iStateId = '" . $iStateId . "'";
        $id = $stateObj->update($where);
        if ($id) {
            $var_msg = "Record Updated Successfully.";
        } else {
            $var_msg = "Eror-in Update.";
        }
    }
}
header("Location:index.php?file=ge-state&view=index&AX=Yes&var_msg={$var_msg}");
exit;