<?php
$edit = $link->hrefquery ();

$query = $db->get_row ( 'users', array ('id' => $edit [1] ) );
?>
<div class="page-content">
	<div class="page-header position-relative"></div>
	<!--/.page-header-->

	<div class="row-fluid">
		<div class="span12">
			<!--PAGE CONTENT BEGINS-->





			<div class="row-fluid">
				<div class="span12">
					<div class="widget-box">
						<div class="widget-header widget-header-blue widget-header-flat">
							<h4 class="lighter">Edit Your Account</h4>


						</div>

						<div class="widget-body">
							<div class="widget-main">
								<div class="row-fluid">


									<div class="step-content row-fluid position-relative"
										id="step-container">
										<div class="step-pane active">

											<form class="form-horizontal" method="post" action="">

												<div class="control-group">
													<label class="control-label" for="form-input-readonly">Email</label>

													<div class="controls">
														<input readonly="" type="text" id="form-input-readonly"
															value="<?php echo $query['email']; ?>" />
														<p class="help-block">Your email is for logging in and
															cannot be changed.</p>
													</div>
												</div>

												<div class="control-group">
													<label class="control-label">Your Name:</label>

													<div class="controls">
														<div class="span12">
															<input type="text" name="edit[name]" class="span6"
																value="<?php echo $query['name'];?>" />
														</div>
													</div>
												</div>

												<div class="control-group">
													<label class="control-label" for="password2">Password:</label>

													<div class="controls">
														<div class="span12">
															<input type="password" name="edit[password]"
																class="span6" />
														</div>
													</div>
												</div>



												<div class="control-group">
													<label class="control-label" for="name">Contact:</label>

													<div class="controls">
														<span class="span12"> <input type="text"
															name="edit[contact]" class="span6"
															value="<?php echo $query['contact'];?>" />
														</span>
													</div>
												</div>

												<div class="control-group">
													<label class="control-label" for="name">Address:</label>

													<div class="controls">
														<span class="span12"> <textarea id="form-field-11"
																class="autosize-transition span6" name="edit[address]"><?php echo $query['address']; ?></textarea>
														</span>
													</div>
												</div>

												<h3>PERMISSIONS</h3>
											<?php
											// echo $edit[1];
											$all = $db->get_col ( "users", array ('id' => $edit [1] ), 'privilege' );
											// $db->debug();
											$total = explode ( ",", $all [0] );
											// print_r($total);
											
											?>
												<!-- <div class="control-group">
														<label class="control-label" for="name">Admin:</label>

														<div class="controls">
															<div class="span3">
																<input name="edit[displayuser]" value="displayuser" 
																<?php
																if (in_array ( 'displayuser', $total )) {
																	echo "checked";
																}
																?> class="ace-checkbox-2" type="checkbox"> <span class="lbl"> Display Admin Member</span>
															</div>
															<div class="span3">
																<input name="edit[newregister]" value="newregister"
																<?php
																if (in_array ( 'newregister', $total )) {
																	echo "checked";
																}
																?>															
																 class="ace-checkbox-2" type="checkbox"> <span class="lbl"> New Admin Member</span>
															</div>
														</div>
													</div> 
													
													<div class="control-group">
														<label class="control-label" for="name">Payments:</label>

														<div class="controls">
															<div class="span3">
																<input name="edit[paymentdetails]" value="paymentdetails"
																<?php
																if (in_array ( 'paymentdetails', $total )) {
																	echo "checked";
																}
																?>		
																 class="ace-checkbox-2" type="checkbox"> <span class="lbl"> Payments Details</span>
															</div>
															<div class="span2">
																<input name="edit[newpayments]" value="newpayments" 
																<?php
																if (in_array ( 'newpayments', $total )) {
																	echo "checked";
																}
																?>	
																class="ace-checkbox-2" type="checkbox"> <span class="lbl"> New Payments</span>
															</div>
														</div>
													</div>-->

												<div class="control-group">
													<label class="control-label" for="name">Awards:</label>

													<div class="controls">
														<div class="span3">
															<input name="edit[mostawarded]" value="mostawarded"
																<?php
																if (in_array ( 'mostawarded', $total )) {
																	echo "checked";
																}
																?>
																class="ace-checkbox-2" type="checkbox"> <span
																class="lbl"> Most Awarded</span>
														</div>
														<div class="span2">
															<input name="edit[earlierawards]" value="earlierawards"
																<?php
																if (in_array ( 'earlierawards', $total )) {
																	echo "checked";
																}
																?>
																class="ace-checkbox-2" type="checkbox"> <span
																class="lbl"> Earlier Awards</span>
														</div>
														<div class="span3">
															<input name="edit[giveanawards]" value="giveanawards"
																<?php
																if (in_array ( 'giveanawards', $total )) {
																	echo "checked";
																}
																?>
																class="ace-checkbox-2" type="checkbox"> <span
																class="lbl"> Give An Awards</span>
														</div>
													</div>
												</div>

												<div class="control-group">
													<label class="control-label" for="name">Employees:</label>

													<div class="controls">
														<div class="span3">
															<input name="edit[employeesdetails]"
																value="employeesdetails"
																<?php
																if (in_array ( 'employeesdetails', $total )) {
																	echo "checked";
																}
																?>
																class="ace-checkbox-2" type="checkbox"> <span
																class="lbl"> Employees Details</span>
														</div>
														<div class="span3">
															<input name="edit[newemployees]" value="newemployees"
																<?php
																if (in_array ( 'newemployees', $total )) {
																	echo "checked";
																}
																?>
																class="ace-checkbox-2" type="checkbox"> <span
																class="lbl"> New Employees</span>
														</div>
													</div>
												</div>

												<!-- <div class="control-group">
														<label class="control-label" for="name">Clients:</label>

														<div class="controls">
															<div class="span3">
																<input name="edit[clientdetails]" value="clientdetails" 
																<?php
																if (in_array ( 'clientdetails', $total )) {
																	echo "checked";
																}
																?>
																class="ace-checkbox-2" type="checkbox"> <span class="lbl"> Clients Details</span>
															</div>
															<div class="span2">
																<input name="edit[newclient]" value="newclient" 
																<?php
																if (in_array ( 'newclient', $total )) {
																	echo "checked";
																}
																?>
																class="ace-checkbox-2" type="checkbox"> <span class="lbl"> New Clients</span>
															</div>
														</div>
													</div> -->

												<div class="control-group">
													<label class="control-label" for="name">Departments:</label>

													<div class="controls">
														<div class="span3">
															<input name="edit[departments]" value="departments"
																<?php
																if (in_array ( 'departments', $total )) {
																	echo "checked";
																}
																?>
																class="ace-checkbox-2" type="checkbox"> <span
																class="lbl"> Departments</span>
														</div>
														<div class="span3">
															<input name="edit[newdepartments]" value="newdepartments"
																<?php
																if (in_array ( 'newdepartments', $total )) {
																	echo "checked";
																}
																?>
																class="ace-checkbox-2" type="checkbox"> <span
																class="lbl"> New Departments</span>
														</div>
													</div>
												</div>


												<div class="control-group">
													<label class="control-label" for="name">Active:</label>

													<div class="controls">
														<span class="span1"> <label>
																				<?php
																				if ($query ['suspen_id'] == '0') {
																					?>
																						<input class="ace-switch" type="checkbox"
																name="edit[suspen_id]" checked /> <span class="lbl"></span>
																					<?php }else{?>
																				 
								                        							<input class="ace-switch"
																type="checkbox" name="edit[suspen_id]" /> <span
																class="lbl"></span>
																				<?php	}?>
																				
																			</label>
														</span>
													</div>
												</div>

												<div class="control-group">

													<div class="controls">
														<span class="span12"> <input type="hidden"
															name="checkedit" value="edit"> <input type="hidden"
															name="id" value="<?php echo $edit1= $edit[1];?>"> <input
															type="hidden" name="hidden_email"
															value="<?php echo $query['email'];?>">
															<button type="submit" name="submit"
																class="btn btn-small btn-primary">Save</button>
														</span>
													</div>
												</div>

											</form>
										</div>
									</div>



								</div>
							</div>
							<!--/widget-main-->
						</div>
						<!--/widget-body-->
					</div>
				</div>
			</div>

			<!--PAGE CONTENT ENDS-->
		</div>
		<!--/.span-->
	</div>
	<!--/.row-fluid-->
</div>
<!--/.page-content-->


</div>
<!--/.main-content-->