Advertisement
Guest User

Untitled

a guest
Jun 5th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.04 KB | None | 0 0
  1. @extends('layouts.app')
  2.  
  3. @section('htmlheader_title')
  4.  
  5. Home
  6.  
  7. @endsection
  8.  
  9.  
  10.  
  11. @section('extraStyle')
  12.  
  13. <style>
  14.  
  15. .spacing-top{
  16.  
  17. margin-top:15px;
  18.  
  19. }
  20.  
  21. #upload-file-selector {
  22.  
  23. display:none;
  24.  
  25. }
  26.  
  27. .margin-correction {
  28.  
  29. margin-right: 10px;
  30.  
  31. }
  32.  
  33. </style>
  34.  
  35. @endsection
  36.  
  37.  
  38.  
  39. @section('main-content')
  40.  
  41. {{-- <section class="content-header">
  42.  
  43. <h1>
  44.  
  45. Blank page
  46.  
  47. <small>it all starts here</small>
  48.  
  49. </h1>
  50.  
  51. <ol class="breadcrumb">
  52.  
  53. <li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
  54.  
  55. <li><a href="#">Examples</a></li>
  56.  
  57. <li class="active">Blank page</li>
  58.  
  59. </ol>
  60.  
  61. </section> --}}
  62.  
  63.  
  64.  
  65. <!-- Main content -->
  66.  
  67. <section class="content">
  68.  
  69.  
  70.  
  71. <!-- Default box -->
  72.  
  73. <div class="box">
  74.  
  75. <div class="box-header with-border">
  76.  
  77. <h3 class="box-title">Tambah Data Pelanggan</h3>
  78.  
  79.  
  80.  
  81. <div class="box-tools pull-right">
  82.  
  83. <a href="{{ route('item.index') }}"<button type="button" class="btn btn-box-tool" style="color: #888; font-size:12pt;" title="tambahkan data item"><i class="fa fa-arrow-left" aria-hidden="true"></i></button></a>
  84.  
  85. </div>
  86.  
  87. </div>
  88.  
  89. <div class="box-body">
  90.  
  91. <div class="row">
  92.  
  93. <div class="col-md-8 col-md-offset-1">
  94.  
  95. <form method="POST">
  96. <input type="hidden" name="_token" value="{{ csrf_token() }}">
  97. <input type="hidden" name="m_id" id="m_id">
  98. <div class="form-group">
  99. <label for="m_username">Username:</label>
  100. <input type="text" class="form-control" id="m_username" name="m_username" value="{{ old('m_username') }}">
  101. @if ($errors->has('m_username'))
  102. <span class="help-block">
  103. <strong>{{ $errors->first('m_username') }}</strong>
  104. </span>
  105. @endif
  106. </div>
  107. <div class="form-group">
  108. <label for="m_passwd">Password :</label>
  109. <input type="password" class="form-control" id="m_passwd" name="m_passwd" value="{{ old('m_passwd') }}">
  110. @if ($errors->has('m_passwd'))
  111. <span class="help-block">
  112. <strong>{{ $errors->first('m_passwd') }}</strong>
  113. </span>
  114. @endif
  115. </div>
  116. <div class="form-group">
  117. <label for="m_name">Nama :</label>
  118. <input type="text" class="form-control" id="m_name" name="m_name" value="{{ old('m_name') }}">
  119. @if ($errors->has('m_name'))
  120. <span class="help-block">
  121. <strong>{{ $errors->first('m_name') }}</strong>
  122. </span>
  123. @endif
  124. </div>
  125. <div class="form-group">
  126. <label for="m_birth_tgl">Tanggal Lahir :</label>
  127. <input type="date" class="form-control" id="m_birth_tgl" name="m_birth_tgl" value="{{ old('m_birth_tgl') }}">
  128. @if ($errors->has('m_birth_tgl'))
  129. <span class="help-block">
  130. <strong>{{ $errors->first('m_birth_tgl') }}</strong>
  131. </span>
  132. @endif
  133. </div>
  134. <div class="form-group">
  135. <label for="mhp_hp">Nomer HP :</label>
  136. <input type="text" class="form-control" id="mhp_hp" name="mhp_hp" value="{{ old('mhp_hp') }}">
  137. @if ($errors->has('mhp_hp'))
  138. <span class="help-block">
  139. <strong>{{ $errors->first('mhp_hp') }}</strong>
  140. </span>
  141. @endif
  142. </div>
  143. <div class="form-group">
  144. <label for="me_email">Email :</label>
  145. <input type="email" class="form-control" id="me_email" name="me_email" value="{{ old('me_email') }}">
  146. @if ($errors->has('me_email'))
  147. <span class="help-block">
  148. <strong>{{ $errors->first('me_email') }}</strong>
  149. </span>
  150. @endif
  151. </div>
  152. <div class="form-group">
  153. <label for="a_alamat">Alamat :</label>
  154. <input type="text" class="form-control" id="a_alamat" name="a_alamat" value="{{ old('a_alamat') }}">
  155. @if ($errors->has('a_alamat'))
  156. <span class="help-block">
  157. <strong>{{ $errors->first('a_alamat') }}</strong>
  158. </span>
  159. @endif
  160. </div>
  161. <div class="form-group">
  162. <label for="hak" class="col-sm-2 control-label">Hak:</label>
  163. <div class="col-sm-5">
  164. <select class="form-control" id="hak" name="hak" id="hak">
  165. <option value="petugas">petugas</option>
  166. <option value="pelanggan">pelanggan</option>
  167. </select>
  168. </div>
  169. </div>
  170. <button type="submit" class="btn btn-default">Submit</button>
  171. <button type="reset" class="btn btn-default">Reset</button>
  172. </form>
  173.  
  174. </div>
  175.  
  176. </div>
  177.  
  178. </div>
  179.  
  180. <!-- /.box-body -->
  181.  
  182.  
  183.  
  184. </div>
  185.  
  186. <!-- /.box -->
  187.  
  188.  
  189.  
  190. </section>
  191.  
  192. <!-- /.content -->
  193.  
  194. @endsection
  195.  
  196.  
  197.  
  198. @section('extraScript')
  199.  
  200. <script type="text/javascript">
  201.  
  202.  
  203.  
  204. $(".uploadGambar").on('change', function () {
  205.  
  206.  
  207.  
  208. //alert($(".uploadGambar").val());
  209.  
  210.  
  211.  
  212. if (typeof (FileReader) != "undefined") {
  213.  
  214.  
  215.  
  216. var image_holder = $(".image-holder");
  217.  
  218. image_holder.empty();
  219.  
  220.  
  221.  
  222. var reader = new FileReader();
  223.  
  224. reader.onload = function (e) {
  225.  
  226. image_holder.html('<img src="{{ asset('image / loading1.gif') }}" class="img-responsive" width="40px">');
  227.  
  228.  
  229.  
  230. $('.save').attr('disabled', true);
  231.  
  232.  
  233.  
  234. setTimeout(function () {
  235.  
  236. image_holder.empty();
  237.  
  238. $("<img />", {
  239.  
  240. "src": e.target.result,
  241.  
  242. "class": "thumb-image img-responsive",
  243.  
  244. "height": "80px",
  245.  
  246. }).appendTo(image_holder);
  247.  
  248. $('.save').attr('disabled', false);
  249.  
  250. }, 2000)
  251.  
  252. }
  253.  
  254. image_holder.show();
  255.  
  256. reader.readAsDataURL($(this)[0].files[0]);
  257.  
  258. } else {
  259.  
  260. alert("This browser does not support FileReader.");
  261.  
  262. }
  263.  
  264.  
  265.  
  266. });
  267.  
  268.  
  269.  
  270. function jenisSubGenerated() {
  271.  
  272. $('.btnSubJenis').html('<i class="fa fa-spinner" aria-hidden="true"></i>');
  273.  
  274. $('.jenisSubSelect').attr('disabled', true);
  275.  
  276. $('.classSelect').attr('disabled', true);
  277.  
  278. $('.subClassSelect').attr('disabled', true);
  279.  
  280. $.ajax({
  281.  
  282. url: '/getSpesificSubJenis/' + $('.i_jenis').val(),
  283.  
  284. method: 'get',
  285.  
  286. success: function (response) {
  287.  
  288. $('.btnSubJenis').html('<i class="fa fa-plus" aria-hidden="true"></i>');
  289.  
  290. $('.subJenisContent').html(response);
  291.  
  292.  
  293.  
  294. classGenerated();
  295.  
  296. //subClassGenerated();
  297.  
  298. }
  299.  
  300. });
  301.  
  302. }
  303.  
  304.  
  305.  
  306. function classGenerated() {
  307.  
  308. if (!$('.classSelect').is(':disabled')) {
  309.  
  310. $('.classSelect').attr('disabled', true);
  311.  
  312. }
  313.  
  314.  
  315.  
  316. $('.btnClass').html('<i class="fa fa-spinner" aria-hidden="true"></i>');
  317.  
  318. $.ajax({
  319.  
  320. url: '/getSpesificClass/' + $('.i_jenissub').val(),
  321.  
  322. method: 'get',
  323.  
  324. success: function (response) {
  325.  
  326. $('.btnClass').html('<i class="fa fa-plus" aria-hidden="true"></i>');
  327.  
  328. $('.classContent').html(response);
  329.  
  330. subClassGenerated();
  331.  
  332. }
  333.  
  334. });
  335.  
  336.  
  337.  
  338.  
  339.  
  340. }
  341.  
  342.  
  343.  
  344. function subClassGenerated() {
  345.  
  346. if (!$('.subClassSelect').is(':disabled')) {
  347.  
  348. $('.subClassSelect').attr('disabled', true);
  349.  
  350. }
  351.  
  352. $('.btnSubClass').html('<i class="fa fa-spinner" aria-hidden="true"></i>');
  353.  
  354. $.ajax({
  355.  
  356. url: '/getSpesificSubClass/' + $('.classSelect').val(),
  357.  
  358. method: 'get',
  359.  
  360. success: function (response) {
  361.  
  362. $('.btnSubClass').html('<i class="fa fa-plus" aria-hidden="true"></i>');
  363.  
  364. $('.subClassContent').html(response);
  365.  
  366. }
  367.  
  368. });
  369.  
  370. }
  371.  
  372.  
  373.  
  374. function tambahJenisBaru() {
  375.  
  376.  
  377.  
  378. var atributBefore = $('.jenisContent').html();
  379.  
  380.  
  381.  
  382. $('.jenisWrapper').html('<div class="jenisContent"> <input type="text" class="form-control" name="i_jenis"/> </div> <span class="input-group-btn"> <button class="btn btn-default" onclick="pilihJenis()" type="button"><i class="fa fa-plus" aria-hidden="true"> </i> </button>< /span>');
  383.  
  384. }
  385.  
  386.  
  387.  
  388. </script>
  389.  
  390. @endsection
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement