ok

Mini Shell

Direktori : /proc/thread-self/root/home2/selectio/www/salemgovtitialumni.in/dashboard/admin/
Upload File :
Current File : //proc/thread-self/root/home2/selectio/www/salemgovtitialumni.in/dashboard/admin/member-edit.php

<?php require_once('header.php'); ?>

<?php
if(isset($_POST['form1'])) {
    
            
            $name=$_POST['name'];
            $father_name = $_POST['father_name'];
            $present_address = $_POST['present_address'];
            $permanent_address = $_POST['permanent_address'];
            $mobile=$_POST['mobile'];
    	    $email=$_POST['email'];
            $education = $_POST['education'];
            $profession = $_POST['profession'];
            $training = $_POST['training'];
            $trade = $_POST['trade'];
            $payment = $_POST['payment'];
            $amount = $_POST['amount'];
            $password = $_POST['password'];
            $member_ship = $_POST['member_ship'];

			$statement = $pdo->prepare("UPDATE tbl_member SET name=?, father_name=?,present_address=?,permanent_address=?
			,phone_no=?,email=?,payment=?,amount=?,education=?,business=?,training=?,trade=?,password=? WHERE id=?");
    		$statement->execute(array($name,$father_name,$present_address,$permanent_address,$mobile,
    		$email,$payment,$amount,$education,$profession,$training,$trade,$password,$_REQUEST['id']));
		
		    if($statement){
		        $success_message = 'Member is updated successfully!';
		    } else{
		        $success_message = 'Somthing Went Wrong!';
		    }  
        
	    

}
?>

<?php
if(!isset($_REQUEST['id'])) {
	header('location: logout.php');
	exit;
} else {
	// Check the id is valid or not
	$statement = $pdo->prepare("SELECT * FROM tbl_member WHERE id=?");
	$statement->execute(array($_REQUEST['id']));
	$total = $statement->rowCount();
	$result = $statement->fetchAll(PDO::FETCH_ASSOC);
	if( $total == 0 ) {
		header('location: logout.php');
		exit;
	}
}
?>

<section class="content-header">
	<div class="content-header-left">
		<h1>Edit Member</h1>
	</div>
	<div class="content-header-right">
		<a href="member.php" class="btn btn-primary btn-sm">View All</a>
	</div>
</section>

<?php
$statement = $pdo->prepare("SELECT * FROM tbl_member WHERE id=?");
$statement->execute(array($_REQUEST['id']));
$result = $statement->fetchAll(PDO::FETCH_ASSOC);

?>

<section class="content">

	<div class="row">
		<div class="col-md-12">

			<?php if($error_message): ?>
			<div class="callout callout-danger">
				<p>
				<?php echo $error_message; ?>
				</p>
			</div>
			<?php endif; ?>

			<?php if($success_message): ?>
			<div class="callout callout-success">
				<p><?php echo $success_message; ?></p>
			</div>
			<?php endif; ?>

			<form class="form-horizontal" action="" method="post" enctype="multipart/form-data">
				<input type="hidden" name="ids" value="<?=$result[0]['id'] ?>">
				<div class="box box-info">
					<div class="box-body">
						<div class="form-group">
							<label for="" class="col-sm-2 control-label">Name <span>*</span></label>
							<div class="col-sm-6">
								<input type="text" autocomplete="off" class="form-control" name="name" value="<?=$result[0]['name'] ?>">
							</div>
						</div>
						<div class="form-group">
							<label for="" class="col-sm-2 control-label">Father Name <span>*</span></label>
							<div class="col-sm-6">
								<input type="text" autocomplete="off" class="form-control" name="father_name" value="<?=$result[0]['father_name'] ?>">
							</div>
						</div>
						<div class="form-group">
							<label for="" class="col-sm-2 control-label">payment <span>*</span></label>
							<div class="col-sm-6">
							    <select name="payment" class="form-control" >
							        <option value="1" <?php if($result[0]['payment']==1){ echo 'selected'; } ?> >Yes</option>
							        <option value="0" <?php if($result[0]['payment']==0){ echo 'selected'; } ?> >No</option>
							    </select>
							</div>
						</div>
						<div class="form-group">
							<label for="" class="col-sm-2 control-label">amount <span>*</span></label>
							<div class="col-sm-6">
								<input type="text" autocomplete="off" class="form-control" name="amount" value="<?=$result[0]['amount'] ?>">
							</div>
						</div>
						<div class="form-group">
							<label for="" class="col-sm-2 control-label">Present Address <span>*</span></label>
							<div class="col-sm-6">
								<textarea class="form-control" name="present_address" style="height:140px;"><?=$result[0]['present_address'] ?></textarea>
							</div>
						</div>	
						<div class="form-group">
							<label for="" class="col-sm-2 control-label">Permanent Address <span>*</span></label>
							<div class="col-sm-6">
								<textarea class="form-control" name="permanent_address" style="height:140px;"><?=$result[0]['permanent_address'] ?></textarea>
							</div>
						</div>	
						<div class="form-group">
							<label for="" class="col-sm-2 control-label">Email <span>*</span></label>
							<div class="col-sm-6">
								<input type="text" autocomplete="off" class="form-control" name="email" value="<?=$result[0]['email'] ?>">
							</div>
						</div>
						
						<div class="form-group">
							<label for="" class="col-sm-2 control-label">Mobile<span>*</span></label>
							<div class="col-sm-6">
								<input type="text" autocomplete="off" class="form-control" name="mobile" value="<?=$result[0]['phone_no'] ?>">
							</div>
						</div>
							<div class="form-group">
							<label for="" class="col-sm-2 control-label">Educational Qualification: <span>*</span></label>
							<div class="col-sm-6">
								<input type="text" autocomplete="off" class="form-control" name="education" value="<?=$result[0]['education'] ?>">
							</div>
						</div>
						<div class="form-group">
							<label for="" class="col-sm-2 control-label">Profession Or Business:<span>*</span></label>
							<div class="col-sm-6">
								<input type="text" autocomplete="off" class="form-control" name="profession" value="<?=$result[0]['business'] ?>">
							</div>
						</div>
						<div class="form-group">
							<label for="" class="col-sm-2 control-label">Training Period: <span>*</span></label>
							<div class="col-sm-6">
								<input type="text" autocomplete="off" class="form-control" name="training" value="<?=$result[0]['training'] ?>">
							</div>
						</div>
						<div class="form-group">
							<label for="" class="col-sm-2 control-label">Trade: <span>*</span></label>
							<div class="col-sm-6">
								<input type="text" autocomplete="off" class="form-control" name="trade" value="<?=$result[0]['trade'] ?>">
							</div>
						</div>
						
						<div class="form-group">
							<label for="" class="col-sm-2 control-label">Password: <span>*</span></label>
							<div class="col-sm-6">
								<input type="text" autocomplete="off" class="form-control" name="password" value="<?=$result[0]['password'] ?>">
							</div>
						</div>
						
						
						<div class="form-group">
							<label for="" class="col-sm-2 control-label"></label>
							<div class="col-sm-6">
								<button type="submit" class="btn btn-success pull-left" name="form1">Update</button>
							</div>
						</div>
					</div>
				</div>
			</form>
		</div>
	</div>

</section>

<?php require_once('footer.php'); ?>

Zerion Mini Shell 1.0