Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!doctype html>
- <!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang=""> <![endif]-->
- <!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang=""> <![endif]-->
- <!--[if IE 8]> <html class="no-js lt-ie9" lang=""> <![endif]-->
- <!--[if gt IE 8]><!--> <html class="no-js" lang=""> <!--<![endif]-->
- <head>
- <meta charset="utf-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <title>Ela Admin - HTML5 Admin Template</title>
- <meta name="description" content="Ela Admin - HTML5 Admin Template">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <link rel="apple-touch-icon" href="https://i.imgur.com/QRAUqs9.png">
- <link rel="shortcut icon" href="https://i.imgur.com/QRAUqs9.png">
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/normalize.css@8.0.0/normalize.min.css">
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.1.3/dist/css/bootstrap.min.css">
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css">
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/lykmapipo/themify-icons@0.1.2/css/themify-icons.css">
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/pixeden-stroke-7-icon@1.2.3/pe-icon-7-stroke/dist/pe-icon-7-stroke.min.css">
- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/flag-icon-css/3.2.0/css/flag-icon.min.css">
- <link rel="stylesheet" href="<?php echo base_url();?>/assets/css/cs-skin-elastic.css">
- <link rel="stylesheet" href="<?php echo base_url();?>/assets/css/style.css">
- <link href='https://fonts.googleapis.com/css?family=Open+Sans:400,600,700,800' rel='stylesheet' type='text/css'>
- <!-- <script type="text/javascript" src="https://cdn.jsdelivr.net/html5shiv/3.7.3/html5shiv.min.js"></script> -->
- </head>
- <body class="bg-dark">
- <div class="sufee-login d-flex align-content-center flex-wrap">
- <div class="container">
- <div class="login-content">
- <div class="login-logo">
- <a href="index.html">
- <img class="align-content" src="<?php echo base_url();?>/assets/images/logo.png" alt="">
- </a>
- </div>
- <div class="login-form">
- <form>
- <div id='error_message'>PESAN MUNCUL DISINI</div>
- <div id='error'>KODE ERROR DISINI</div>
- <div class="form-group">
- <label>NO RESELLER</label>
- <input type="text" class="form-control" name="nors" id="nors" placeholder="NO RESELLER">
- </div>
- <div class="form-group">
- <label>ID DIGIPOS</label>
- <input type="text" name="digiposid" class="form-control" id="digiposid" placeholder="ID DIGIPOS">
- </div>
- <div class="form-group">
- <label>Password</label>
- <input type="password" name="password" class="form-control" id="password" placeholder="Password">
- </div>
- <div class="form-group">
- <label>Nama Toko</label>
- <input type="text" name="nmtoko" class="form-control" id="nmtoko" placeholder="Nama Toko">
- </div>
- <button type="submit" onclick="reload2()" class="btn btn-primary btn-flat m-b-30 m-t-30">Register</button>
- <div class="register-link m-t-15 text-center">
- <p>Already have account ? <a href="<?php echo site_url('Welcome');?>"> Sign in</a></p>
- </div>
- </form>
- </div>
- </div>
- </div>
- </div>
- <script src="https://cdn.jsdelivr.net/npm/jquery@2.2.4/dist/jquery.min.js"></script>
- <script src="https://cdn.jsdelivr.net/npm/popper.js@1.14.4/dist/umd/popper.min.js"></script>
- <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.1.3/dist/js/bootstrap.min.js"></script>
- <script src="https://cdn.jsdelivr.net/npm/jquery-match-height@0.7.2/dist/jquery.matchHeight.min.js"></script>
- <script src="<?php echo base_url();?>/assets/js/main.js"></script>
- <script type="text/javascript">
- url = "<?php echo site_url('Auth/Register');?>";
- function reload2() {
- data = {
- 'nors': document.getElementById('nors').value,
- 'digiposid': document.getElementById('digiposid').value,
- 'nmtoko': document.getElementById('nmtoko').value,
- 'password': document.getElementById('password').value
- }
- console.log(data);
- obj = ajaxPostJson(url, data, false);
- console.log(obj);
- if (obj.error != false) {
- document.getElementById('error').innerHTML = obj.status;
- document.getElementById('error_message').innerHTML = obj.message;
- } else {
- res = obj.result;
- document.getElementById('error').innerHTML = res.error;
- document.getElementById('error_message').innerHTML = res.error_message;
- }
- }
- //=================core js =
- function ajaxGetShowId(url, targetId, async = true, debug = 0) {
- var xhttp = xmlHttp();
- if (async != true) async = false;
- xhttp.open("GET", url, async);
- xhttp.onreadystatechange = function() {
- if (debug == 1) {
- console.log(xhttp);
- }
- if (xhttp.readyState != 4 || xhttp.status != 200) {
- return 0;
- } else {
- document.getElementById(targetId).innerHTML = xhttp.responseText;
- }
- };
- xhttp.send();
- /*bila TIDAK menggunakan async maka bisa mengembalikan hasil*/
- response = {
- detail: xhttp,
- text: xhttp.responseText,
- state: xhttp.readyState,
- status: xhttp.status,
- url: xhttp.responseURL,
- type: xhttp.responseType
- }
- return response;
- }
- function ajaxGetJson(url, async = false, debug = 0) {
- var xhttp = xmlHttp();
- if (async != true) async = false;
- xhttp.open("GET", url, async);
- xhttp.onreadystatechange = function() {
- if (debug == 1) {
- console.log(xhttp);
- }
- if (xhttp.readyState != 4 || xhttp.status != 200) {
- return 0;
- }
- };
- xhttp.send();
- response = {
- state: xhttp.readyState,
- status: xhttp.status,
- url: xhttp.responseURL,
- type: xhttp.responseType
- }
- text = xhttp.responseText;
- try {
- json = JSON.parse(text);
- response.result = json;
- response.error = false;
- response.message = 'OK';
- } catch (err) {
- response.result = false;
- response.error = err;
- response.message = err.message;
- }
- return response;
- }
- function ajaxPostJson(url, data = array(), async = false, debug = 0) {
- var xhttp = xmlHttp();
- if (async != true) async = false;
- xhttp.open("POST", url, async);
- // xhttp.setRequestHeader('Content-Type', 'application/json');
- xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
- xhttp.onreadystatechange = function() {
- if (debug == 1) {
- console.log(xhttp);
- }
- if (xhttp.readyState != 4 || xhttp.status != 200) {
- return 0;
- }
- };
- params = param(data);
- console.log(params);
- xhttp.send(params); //JSON.stringify(data) );
- response = {
- state: xhttp.readyState,
- status: xhttp.status,
- url: xhttp.responseURL,
- type: xhttp.responseType
- }
- text = xhttp.responseText;
- try {
- json = JSON.parse(text);
- response.result = json;
- response.error = false;
- response.message = 'OK';
- } catch (err) {
- response.result = false;
- response.error = err;
- response.message = err.message;
- }
- return response;
- }
- function xmlHttp() {
- if (window.XMLHttpRequest) {
- xhttp = new XMLHttpRequest();
- } else {
- // code for IE6, IE5
- xhttp = new ActiveXObject("Microsoft.XMLHTTP");
- //new ActiveXObject("MSXML2.XMLHTTP.3.0")
- }
- return xhttp;
- }
- function param(object) {
- var encodedString = '';
- for (var prop in object) {
- if (object.hasOwnProperty(prop)) {
- if (encodedString.length > 0) {
- encodedString += '&';
- }
- encodedString += encodeURI(prop + '=' + object[prop]);
- }
- }
- return encodedString;
- }
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement