<div class="page-content-wrapper">
                <div class="page-content">
                    <div class="page-bar">
                        <div class="page-title-breadcrumb">
                            <div class=" pull-left">
                                <div class="page-title"><?php if($isEdit){ echo 'Edit Project';} else { echo 'Add Project'; }?></div>
                            </div>
                            <ol class="breadcrumb page-breadcrumb pull-right">
                                <li><i class="fa fa-home"></i>&nbsp;<a class="parent-item" href="index.html">Home</a>&nbsp;<i class="fa fa-angle-right"></i>
                                </li>
                                <li><a class="parent-item" href="">Projects</a>&nbsp;<i class="fa fa-angle-right"></i></li><li class="active">Add Project</li>
                            </ol>
                        </div>
                    </div>
<div class="row">
                        <div class="col-md-12 col-sm-12">
                            <div class="card card-box">
                                <div class="card-head">
                                    <header><?php if($isEdit){ echo 'Edit Project';} else { echo 'Add Project'; }?></header>                                    
                                </div>
                                <div class="card-body" id="bar-parent1">
                                	
                                	<?php if(isset($error) && $error!='') { ?> 
                                	<div class="alert alert-danger"><?php echo $error; ?></div>
                                	<?php } else if(isset($success) && $success!=''){ ?>                                		
                                		<div class="alert alert-success"><?php echo $success; ?></div>
                                	<?php } else if(isset($_REQUEST['success'])){ ?>                                		
                                		<div class="alert alert-success"><?php echo $_REQUEST['success']; ?></div>
                                	<?php } ?>
                                	                                	
                                    <form action="" id="form_staff_add" class="form-horizontal" method="post" enctype="multipart/form-data">
                                        <div class="form-body">
                                        	
                                        	<div class="form-group row">
                                                <label class="control-label col-md-3">Select Project Type</label>
                                                <div class="col-md-4">                                                    
                                                    <select name="type" id="type" class="form-control" >
                                                    	<option value="">--Select Type--</option>
										              <?php if(mysqli_num_rows($typeRs)>0){
										              	while($typeRec = mysqli_fetch_array($typeRs)){ ?>
										              	<option value="<?php echo $typeRec['id']; ?>" <?php if(isset($_POST['type']) && $_POST['type']==$typeRec['id']) { echo 'selected="selected"'; } else if(isset($resEdit['type']) && $resEdit['type']==$typeRec['id']){ echo 'selected="selected"'; } ?> ><?php echo $typeRec['name']; ?></option>
										              <?php } } ?>
										            </select>
                                                </div>
                                            </div>
                                        	                                        	 
                                            <div class="form-group row">
                                                <label class="control-label col-md-3">Project Name<span class="required"> * </span></label>
                                                <div class="col-md-4">                                                    
                                                    <input name="name" type="text" id="name" data-required="1" class="form-control" value="<?php if(isset($_POST['name'])) { echo htmlentities(($_POST['name']), ENT_QUOTES); } else if(isset($resEdit['name']) && $resEdit['name']!=''){ echo $resEdit['name'];} ?>"/>
                                                </div>
                                            </div>
                                            <div class="form-group row">
                                                <label class="control-label col-md-3">Description<span class="required"> * </span></label>
                                                <div class="col-md-4">        
                                                	<textarea name="description" id="description"><?php if(isset($_POST['description'])) { echo htmlentities(($_POST['description']), ENT_QUOTES); } else if(isset($resEdit['description']) && $resEdit['description']!=''){ echo $resEdit['description'];} ?></textarea>                                            
                                                </div>
                                            </div>
                                            <div class="form-group row">
                                                <label class="control-label col-md-3">Client Details<span class="required"> * </span></label>
                                                <div class="col-md-4">        
                                                	<textarea name="client_details" id="client_details"><?php if(isset($_POST['client_details'])) { echo htmlentities(($_POST['client_details']), ENT_QUOTES); } else if(isset($resEdit['client_details']) && $resEdit['client_details']!=''){ echo $resEdit['client_details'];} ?></textarea>                                            
                                                </div>
                                            </div>
                                            <div class="form-group row">
                                                <label class="control-label col-md-3">Total Amount<span class="required"> * </span></label>
                                                <div class="col-md-4">                                                                                                                                                                   
                                                        <input name="total_amount" type="text" id="total_amount" class="form-control" value="<?php if(isset($_POST['total_amount'])) { echo htmlentities(($_POST['total_amount']), ENT_QUOTES); } else if(isset($resEdit['total_amount']) && $resEdit['total_amount']!=''){ echo $resEdit['total_amount'];} ?>" />
                                                </div>
                                            </div>
                                            <div class="form-group row">
	                                            <label class="col-md-3 control-label">Select Start Date</label>
	                                            <div class="input-group date form_date col-md-4" data-date="<?php if(isset($_POST['start_date'])){ echo $_POST['start_date']; } else if(isset($resEdit['start_date'])){ echo getFormattedDate($resEdit['start_date']); }?>" data-date-format="dd-mm-yyyy" data-link-field="dtp_input2" data-link-format="yyyy-mm-dd">
	                                                <input class="form-control" size="16" value="<?php if(isset($_POST['start_date'])){ echo $_POST['start_date']; } else if(isset($resEdit['start_date'])){ echo getFormattedDate($resEdit['start_date']); }?>" type="text">
	                                                <span class="input-group-addon"><span class="fa fa-remove"></span></span>
	                                                <span class="input-group-addon"><span class="fa fa-calendar"></span></span>
	                                            </div>
	                                            <input name="start_date" id="dtp_input2" value="<?php if(isset($_POST['start_date'])){ echo $_POST['start_date']; } else if(isset($resEdit['start_date'])){ echo getFormattedDate($resEdit['start_date']); }?>" type="hidden">
	                                            <br>
	                                        </div>
	                                        <div class="form-group row">
	                                            <label class="col-md-3 control-label">Select End Date</label>
	                                            <div class="input-group date form_date col-md-4" data-date="<?php if(isset($_POST['end_date'])){ echo $_POST['end_date']; } else if(isset($editRec['end_date'])){ echo getFormattedDate($resEdit['end_date']); }?>" data-date-format="dd-mm-yyyy" data-link-field="dtp_input3" data-link-format="yyyy-mm-dd">
	                                                <input class="form-control" size="16" value="<?php if(isset($_POST['end_date'])){ echo $_POST['end_date']; } else if(isset($resEdit['end_date'])){ echo getFormattedDate($resEdit['end_date']); }?>" type="text">
	                                                <span class="input-group-addon"><span class="fa fa-remove"></span></span>
	                                                <span class="input-group-addon"><span class="fa fa-calendar"></span></span>
	                                            </div>
	                                            <input name="end_date" id="dtp_input3" value="<?php if(isset($_POST['end_date'])){ echo $_POST['end_date']; } else if(isset($resEdit['end_date'])){ echo getFormattedDate($resEdit['end_date']); }?>" type="hidden">
	                                            <br>
	                                        </div>
	                                        <?php if($isEdit){ ?>
	                                        <div class="form-group row">
                                                <label class="control-label col-md-3">Status<span class="required"> * </span></label>
                                                <div class="col-md-4">        
                                                	 <select name="status" id="status" class="form-control" >
                                                    	<option value="">--Select Status--</option>
                                                    	<option value="new" <?php if(isset($_POST['status']) && $_POST['status']=='new') { echo 'selected="selected"'; } else if(isset($resEdit['status']) && $resEdit['status']=='new'){ echo 'selected="selected"'; } ?> >New</option>
											            <option value="in_progress" <?php if(isset($_POST['status']) && $_POST['status']=='in_progress') { echo 'selected="selected"'; } else if(isset($resEdit['status']) && $resEdit['status']=='in_progress'){ echo 'selected="selected"'; } ?> >In Progress</option>
											            <option value="completed" <?php if(isset($_POST['status']) && $_POST['status']=='completed') { echo 'selected="selected"'; } else if(isset($resEdit['status']) && $resEdit['status']=='completed'){ echo 'selected="selected"'; } ?> >Completed</option>  
											         </select>                                           
                                                </div>
                                            </div>
                                            <?php } ?>
                                        </div>                                        
                                      	<div class="form-group">
                                            <div class="offset-md-3 col-md-9">
                                            	<?php if($isEdit){ ?>
                                            		<button type="submit" name="update" class="btn btn-info">Update</button>
                                            	<?php } else { ?>
                                            		<button type="submit" name="add" class="btn btn-info">Submit</button>
                                            	<?php } ?>     
                                            </div>
                                        </div>
                                    </form>
                                </div>
                            </div>
                        </div>
                    </div>
	</div>
</div>
