<?php
$getid = $link->hrefquery ();
if ($getid [0] == 'delete') {
	$delete = $db->delete ( "status", array ("id" => $getid [1] ) );
	if ($delete) {
		?>
<div id="hide">
	<div id="gritter-notice-wrapper">
		<div id="gritter-item-1" class="gritter-item-wrapper gritter-success"
			style="">
			<div class="gritter-top"></div>
			<div class="gritter-item">

				<div class="gritter-without-image">
					<span class="gritter-title">Cheers..
						<div class="gritter-close" id="gritterremove"
							style="display: inline;"></div>
					</span>
					<p>Your Record Is Deleted...</p>
				</div>
				<div style="clear: both"></div>
			</div>
			<div class="gritter-bottom"></div>
		</div>
	</div>
</div>
<?php
		$session->redirect ( "new_client", Admin );
	} else {
		?>
<div class="hide1">
	<div id="gritter-notice-wrapper">
		<div id="gritter-item-2" class="gritter-item-wrapper gritter-warning"
			style="">
			<div class="gritter-top"></div>
			<div class="gritter-item">
				<div class="gritter-close" id="gritterremove"
					style="display: inline;"></div>
				<h5>Oops! There Are Some Problem In Updated...</h5>
				<div style="clear: both"></div>
			</div>
			<div class="gritter-bottom"></div>
		</div>
	</div>
</div>

<?php
	
	}
}
?>
<?php

if (isset ( $_POST ['submit'] ) && $_POST ['check'] == 'client') {
	$client = $_POST ['client'];
	
	$full_name = $client ['full_name'];
	$email = $client ['email'];
	$c_name = $client ['c_name'];
	$address = $client ['address'];
	$country = $client ['country'];
	$telephone = $client ['telephone'];
	$mobile = $client ['mobile'];
	$skype = $client ['skype'];
	$gtalk = $client ['gtalk'];
	$status = $client ['status'];
	$notes = $client ['notes'];
	$sec_status = $client ['sec_status'];
	
	$userid = $db->get_col ( "users", array ("email" => $uemail ), 'id' );
	$query = $db->insert ( 'clients', array ('full_name' => $full_name, 'email' => $email, 'c_name' => $c_name, 'address' => $address, 'country' => $country, 'telephone' => $telephone, 'mobile' => $mobile, 'skype' => $skype, 'gtalk' => $gtalk, 'status' => $status, 'notes' => $notes, 'sec_status' => $sec_status, 'user_id' => $userid [0], 'created_date' => date ( "Y/m/d" ) . ' ' . date ( "H:i:s" ) ) );
	// $e_name = $db->get_col ( 'users', array ('email' => $uemail ), 'name' );
	if ($query) {
		/*
		 * $settingcheck = $db->get_col ( "setting", array ('id' => 1 ),
		 * 'c_email' ); if ($settingcheck [0] != '') { $to = $uemail; $message =
		 * "your new client name:" . $full_name; $name = $e_name [0]; $return =
		 * $mail->send_email ( $to, $message, $name, C_NAME, C_EMAIL ); }
		 */
		?>
<div id="hide">
	<div id="gritter-notice-wrapper">
		<div id="gritter-item-1" class="gritter-item-wrapper gritter-success"
			style="">
			<div class="gritter-top"></div>
			<div class="gritter-item">

				<div class="gritter-without-image">
					<span class="gritter-title">Cheers..
						<div class="gritter-close" id="gritterremove"
							style="display: inline;"></div>
					</span>
					<p>Your Record Is Inserted...</p>
				</div>
				<div style="clear: both"></div>
			</div>
			<div class="gritter-bottom"></div>
		</div>
	</div>
</div>
<?php
	
	} else {
		?>
<div class="hide1">
	<div id="gritter-notice-wrapper">
		<div id="gritter-item-2" class="gritter-item-wrapper gritter-warning"
			style="">
			<div class="gritter-top"></div>
			<div class="gritter-item">
				<div class="gritter-close" id="gritterremove"
					style="display: inline;"></div>
				<h5>Oops! There Are Some Problem In Updated...</h5>
				<div style="clear: both"></div>
			</div>
			<div class="gritter-bottom"></div>
		</div>
	</div>
</div>

<?php
	
	}
}
?>
<?php

if (isset ( $_POST ['sta_button'] )) {
	$name = $_POST ['name'];
	$radio = $_POST ['radio'];
	$insert = $db->insert ( "status", array ("name" => $name, 'class' => $radio ) );
	if ($insert) {
		?>
<div id="hide">
	<div id="gritter-notice-wrapper">
		<div id="gritter-item-1" class="gritter-item-wrapper gritter-success"
			style="">
			<div class="gritter-top"></div>
			<div class="gritter-item">

				<div class="gritter-without-image">
					<span class="gritter-title">Cheers..
						<div class="gritter-close" id="gritterremove"
							style="display: inline;"></div>
					</span>
					<p>Your Record Is Inserted...</p>
				</div>
				<div style="clear: both"></div>
			</div>
			<div class="gritter-bottom"></div>
		</div>
	</div>
</div>
<?php
	
	} else {
		?>
<div class="hide1">
	<div id="gritter-notice-wrapper">
		<div id="gritter-item-2" class="gritter-item-wrapper gritter-warning"
			style="">
			<div class="gritter-top"></div>
			<div class="gritter-item">
				<div class="gritter-close" id="gritterremove"
					style="display: inline;"></div>
				<h5>Oops! There Are Some Problem In Updated...</h5>
				<div style="clear: both"></div>
			</div>
			<div class="gritter-bottom"></div>
		</div>
	</div>
</div>
<?php
	
	}
}
?>