예제 #1
0
?>
<div class="container theme-showcase" role="main">
    <div class="jumbotron">
        <h1>Cadastro de novos clientes</h1>
        <p>Preencha o formulário para adicionar um novo cliente.</p>
    </div>
    <?php 
if ($_POST) {
    if ($_POST['action'] == 'update') {
        if (update_client($_POST['id'], $_POST['name'], $_POST['email'], $_POST['tel'], $connection) == 'true') {
            echo '<div class="row"><div class="alert alert-success" role="alert"><strong>Sucesso! </strong>Seu cliente foi atualizado.</div></div>';
        } else {
            echo '<div class="alert alert-danger" role="alert"><strong>Ops... </strong> Houve um erro, tente novamente.</div>';
        }
    } else {
        if (add_client($_POST['name'], $_POST['email'], $_POST['tel'], $connection) == 'true') {
            echo '<div class="row"><div class="alert alert-success" role="alert"><strong>Sucesso! </strong>Seu cliente foi adicionado.</div></div>';
        } else {
            echo '<div class="alert alert-danger" role="alert"><strong>Ops... </strong> Houve um erro, tente novamente.</div>';
        }
    }
}
?>
    <div class="row">
	    <div class="col-md-8">
	    	<?php 
if ($_GET && is_numeric($_GET['id'])) {
    $object = get_data('cliente', $_GET['id'], $connection);
    ?>
		    	<form method="POST" action="<?php 
    echo $_SERVER['PHP_SELF'];
예제 #2
0
파일: client.php 프로젝트: neoloc/mscadmin
include_once dirname(__FILE__) . "/../db_connect.php";
include_once dirname(__FILE__) . "/../functions.php";
if (session_status() == PHP_SESSION_NONE) {
    sec_session_start();
}
// are you logged in?
if (!isset($_SESSION['username'])) {
    gohome();
}
// are you in the correct group?
if ($_SESSION['role_id'] < 2) {
    errormsg('Your role does not have access to this resource');
} else {
    if (isset($_POST['client_name'])) {
        // sanitise variables for security
        $client_name = filter_input(INPUT_POST, 'client_name', FILTER_SANITIZE_STRING);
        if (check_client_name_isfree($client_name, $mysqli)) {
            if (add_client($client_name, $mysqli)) {
                echo "\n\t\t\t\t\t\t<!-- Begin Content Division -->\n\t\t\t\t\t\t<div id='content'>\t\t\t\t\t\n\t\t\t\t\t\t\t<legend>Create Client</legend>\n\t\t\t\t\t\t\t" . quickalert("success", "New client '" . $client_name . "' has been added to the database.\n\t\t\t\t\t\t\t\t\t<a class='alert-link' href='" . SITE_URL . "/?do=create&object=domain'>Add Domain</a>") . "\n\t\t\t\t\t\t<!-- End Content Division -->\n\t\t\t\t\t\t</div>\n\t\t\t\t\t";
            } else {
                errormsg("Failed to insert new record into the database");
            }
        } else {
            errormsg("There is already a client called '" . $client_name . "' in the database!");
        }
    } elseif (!$_POST) {
        echo "\n\t\t<!-- Begin Content Division -->\n\t\t<div id='content'>\n\t\t\t<form class='form-horizontal' action='" . SITE_URL . "/?do=create&object=client' method='post' name='create_client'>\n\t\t\t\t<fieldset>\n\t\t\t\t\n\t\t\t\t<legend>Create Client</legend>\n\t\t\t\t" . quickalert("info", "Client names must be alphanumeric. They can contain spaces, underscores and dashes.") . "\n\t\t\t\t<div class='form-group'>\n\t\t\t\t  <label class='col-md-4 control-label' for='textinput'>Client Name</label>  \n\t\t\t\t  <div class='col-md-4'>\n\t\t\t\t  <input required name='client_name' name='client_name' type='text' placeholder='InternetWigits' pattern='^([a-zA-Z0-9]){3,50}\$' class='form-control input-md'>\n\t\t\t\t  <span class='help-block'>Enter the Clients Name Here.</span>  \n\t\t\t\t  </div>\n\t\t\t\t</div>\n\t\t\t\t\n\t\t\t\t<div class='form-group'>\n\t\t\t\t  <label class='col-md-4 control-label' for='singlebutton'></label>\n\t\t\t\t  <div class='col-md-4'>\n\t\t\t\t    <button id='singlebutton' name='singlebutton' class='btn success large' type='submit'><span class='glyphicon glyphicon-plus-sign' id='logIcon'></span> Create </button>\n\t\t\t\t  </div>\n\t\t\t\t</div>\n\t\t\t\t\n\t\t\t\t</fieldset>\n\t\t\t</form>\n\t\t<!-- End Content Division -->\n\t\t</div>\n\t\t";
    } else {
        errormsg('POST error. Possible missing input.');
    }
}
예제 #3
0
     BannerClientDelete($cid, $ok);
     break;
 case "BannerClientEdit":
     BannerClientEdit($cid);
     break;
 case "BannerClientChange":
     BannerClientChange($cid, $name, $contact, $email, $extrainfo, $login, $passwd);
     break;
 case "BannerStatus":
     BannerStatus($bid, $status);
     break;
 case "add_banner":
     add_banner();
     break;
 case "add_client":
     add_client();
     break;
 case "ad_positions":
     ad_positions();
     break;
 case "position_save":
     position_save($apid, $ad_position_number, $ad_position_name, $position_new);
     break;
 case "position_edit":
     position_edit($apid);
     break;
 case "position_delete":
     position_delete($apid, $ok, $active, $new_pos);
     break;
 case "ad_terms":
     ad_terms($save, $terms_body, $country);