<div class="col-md-8">
    									<button id="sbt" name="sbt" class="btn btn-success">Insert</button>
  								</div>
						</div>
				</fieldset>
			</form>
			
			<?php 
include "supControl.php";
include_once "Supplier.php";
if (isset($_POST['sbt'])) {
    //creates the model class
    if (filter_input(INPUT_POST, 'npwd') == filter_input(INPUT_POST, 'vpwd')) {
        $newSup = new Supplier();
        //setting values to model Item
        $newSup->setName(filter_input(INPUT_POST, 'sname'));
        $newSup->setNIC(filter_input(INPUT_POST, 'nic'));
        $newSup->setPrev(filter_input(INPUT_POST, 'prv'));
        $newSup->setLPN(filter_input(INPUT_POST, 'lpn'));
        $newSup->setMPN(filter_input(INPUT_POST, 'mpn'));
        $newSup->setEmail(filter_input(INPUT_POST, 'email'));
        $newSup->setADR(filter_input(INPUT_POST, 'adr'));
        $newSup->setPWD(filter_input(INPUT_POST, 'npwd'));
        $reulst = supControl::Insert($newSup);
        //prints the alert
        if ($reulst > 0) {
            echo "Data Inserted Successfully.";
        } else {
            echo "Error Inserting Record.";
        }
    } else {
예제 #2
0
     $supplier->setValue('appstatus', $_POST['Status_ID']);
 }
 if (isset($_POST['sremarks'])) {
     $supplier->setValue('sremarks', $_POST['sremarks']);
 }
 if (isset($_POST['appdatedb'])) {
     $supplier->setValue('appdatedb', $_POST['appdatedb']);
 }
 if (isset($_POST['supscopeid'])) {
     $supplier->setValue('supscopeid', $_POST['supscopeid']);
 }
 if (isset($_POST['showinlist'])) {
     $supplier->setValue('showinlist', $_POST['showinlist']);
 }
 $supplier->setSID($cid);
 $supplier->setName($_POST['name']);
 $supplier->setAddressl1($_POST['addl1']);
 $supplier->setAddressl2($_POST['addl2']);
 $supplier->setContactPerson($_POST['cper']);
 $supplier->setPhoneNo($_POST['phone']);
 $supplier->setTINNo($_POST['tinno']);
 $supplier->setPANNo($_POST['panno']);
 $supplier->setExciseNo($_POST['excise']);
 $supplier->saveSupplier($cid);
 $supplier->saveScope();
 if ($pimg != '') {
     $supplier->delBrand($pimg);
 }
 if ($blistsupplier != '') {
     $supplier->saveBrand($blistsupplier);
 }