Пример #1
0
						$(document).ready(function() {
							 $('#create').hide();
						});
					</script>
			<div class="title">
				<h2>Customers</h2>
				<p><small>Manage the customers.</small></p>
			</div>
			<div class="entry">
			<p><?php 
echo $msg;
?>
</p>
				<?php 
if (isset($_GET['edit']) && $customer->validId($_GET['edit'])) {
    $info = $customer->getInfo($_GET['edit']);
    ?>
				<fieldset>
					<legend>Edit</legend>
					<form action="customers.php" method="post">
						<label for="mail">E-mail:</label><br><br>
						<input type="text" id="mail" name="mail" value="<?php 
    echo $info['mail'];
    ?>
"/><br><br>
						<label for="name">Full Name:</label><br><br>
						<input type="text" id="name" name="name" value="<?php 
    echo $info['name'];
    ?>
"/><br><br>
						<label for="city">City:</label><br><br>
Пример #2
0
<?php

//required includes at start
require_once 'inc/top.php';
//others required includes only here
require_once 'inc/session.php';
require_once 'inc/functions/time.php';
require_once 'inc/classes/call.php';
require_once 'inc/classes/customer.php';
require_once 'inc/classes/web.php';
require_once 'inc/classes/subject.php';
require_once 'inc/classes/country.php';
$call = new call();
$info = $call->getInfo($_GET['id']);
$customer = new customer();
$info2 = $customer->getInfo($info['customer']);
if (isset($_POST['edit'])) {
    $duration = $_POST['minutes'] * 60 + $_POST['seconds'];
    if ($customer->exists($_POST['mail'], false)) {
        $call->edit($_POST['id'], $_SESSION['users']['id'], $_POST['type'], $_POST['web'], $_POST['subject'], $duration, $_POST['comments'], $customer->MailToId($_POST['mail']));
    } else {
        $customer->create($_POST['name'], $_POST['mail'], $_POST['city'], $_POST['country'], $_POST['phone']);
        $call->edit($_POST['id'], $_SESSION['users']['id'], $_POST['type'], $_POST['web'], $_POST['subject'], $duration, $_POST['comments'], $customer->MailToId($_POST['mail']));
    }
    $msg = $call->printNiceLog(false);
    $_GET['id'] = $_POST['id'];
    $info = $call->getInfo($_GET['id']);
    $info2 = $customer->getInfo($info['customer']);
}
$html['title'] = 'Edit';
$html['head'] = '<script src="themes/' . THEME . '/js/jquery.js" type="text/javascript"></script>';