Guest User

firstdata

a guest
May 31st, 2017
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.85 KB | None | 0 0
  1. <?php include_once "session.php";
  2.  
  3. if(!$link)
  4. {
  5. die('not connected');
  6. }
  7. $mlink= mysqli_query($link, "select * from products where id>0");
  8. $row= mysqli_fetch_array($mlink);
  9. if(isset($_POST["submit"]))
  10. {
  11. $uname = $_POST['pcode'];
  12. $ucredits = $_POST['nqty'];
  13. $unotes = $_POST['notes'];
  14.  
  15. if($link === false){
  16. die("ERROR: Could not connect. " . mysqli_connect_error());
  17. }
  18. //$sql = ("UPDATE users SET name = '$uname', mobile = '$umobile', userid = '$uemail', password = '$upassword', address = '$uaddress', tin = '$utin', wot = '$uwot' WHERE id='$ID'");
  19. $sql = "INSERT INTO stock (product, nstock, notes, date) VALUES ('$uname', '$ucredits', '$unotes',now())";
  20. if(mysqli_query($link, $sql)){
  21. echo "Records added successfully.";
  22. } else{
  23. echo "ERROR: Could not able to execute $sql. " . mysqli_error($link);
  24. }
  25. $sql2 = ("UPDATE products SET qty = qty+'$ucredits' WHERE productcode='$uname'");
  26. if(mysqli_query($link, $sql2)){
  27. echo "Records added successfully.";
  28. } else{
  29. echo "ERROR: Could not able to execute $sql. " . mysqli_error($link);
  30. }
  31. // close connection
  32. mysqli_close($link);
  33. }
  34. ?>
  35. <!DOCTYPE html>
  36. <!--
  37. This is a starter template page. Use this page to start your new project from
  38. scratch. This page gets rid of all links and provides the needed markup only.
  39. -->
  40. <html>
  41. <head>
  42. <meta charset="utf-8">
  43. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  44. <title>AdminLTE 2 | Starter</title>
  45. <!-- Tell the browser to be responsive to screen width -->
  46. <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
  47. <!-- Bootstrap 3.3.6 -->
  48. <link rel="stylesheet" href="bootstrap/css/bootstrap.min.css">
  49. <!-- Font Awesome -->
  50. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/css/font-awesome.min.css">
  51. <!-- Ionicons -->
  52. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ionicons/2.0.1/css/ionicons.min.css">
  53. <!-- Theme style -->
  54. <link rel="stylesheet" href="dist/css/AdminLTE.min.css">
  55. <!-- AdminLTE Skins. We have chosen the skin-blue for this starter
  56. page. However, you can choose any other skin. Make sure you
  57. apply the skin class to the body tag so the changes take effect.
  58. -->
  59. <link rel="stylesheet" href="dist/css/skins/skin-blue.min.css">
  60.  
  61. <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
  62. <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
  63. <!--[if lt IE 9]>
  64. <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
  65. <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
  66. <![endif]-->
  67. </head>
  68. <!--
  69. BODY TAG OPTIONS:
  70. =================
  71. Apply one or more of the following classes to get the
  72. desired effect
  73. |---------------------------------------------------------|
  74. | SKINS | skin-blue |
  75. | | skin-black |
  76. | | skin-purple |
  77. | | skin-yellow |
  78. | | skin-red |
  79. | | skin-green |
  80. |---------------------------------------------------------|
  81. |LAYOUT OPTIONS | fixed |
  82. | | layout-boxed |
  83. | | layout-top-nav |
  84. | | sidebar-collapse |
  85. | | sidebar-mini |
  86. |---------------------------------------------------------|
  87. -->
  88. <body class="hold-transition skin-blue sidebar-mini">
  89. <div class="wrapper">
  90.  
  91. <!-- Main Header -->
  92. <header class="main-header">
  93.  
  94. <!-- Logo -->
  95. <a href="index2.html" class="logo">
  96. <!-- mini logo for sidebar mini 50x50 pixels -->
  97. <span class="logo-mini"><b>A</b>LT</span>
  98. <!-- logo for regular state and mobile devices -->
  99. <span class="logo-lg"><b>Divine</b>CAARDS</span>
  100. </a>
  101.  
  102. <!-- Header Navbar -->
  103. <?php include_once "sidebar.php"; ?>
  104.  
  105. <!-- Content Wrapper. Contains page content -->
  106. <div class="content-wrapper">
  107. <!-- Content Header (Page header) -->
  108. <section class="content-header">
  109. <h1>Add Credits to User
  110. <small>Credit Information</small>
  111. </h1>
  112. <ol class="breadcrumb">
  113. <li><a href="#"><i class="fa fa-dashboard"></i> Level</a></li>
  114. <li class="active">Here</li>
  115. </ol>
  116. </section>
  117.  
  118. <!-- Main content -->
  119. <section class="content">
  120.  
  121. <!-- Your Page Content Here -->
  122.  
  123. <div class="row">
  124. <!-- left column -->
  125. <div class="col-md-12">
  126. <!-- general form elements -->
  127. <div class="box box-primary">
  128. <div class="box-header with-border">
  129.  
  130. </div>
  131. <!-- /.box-header -->
  132. <!-- form start -->
  133. <form action="" method="post">
  134. <div class="box-body">
  135. <div class="form-group">
  136. <label for="Username">User ID</label>
  137.  
  138. <input list="pcode" required="required" class="form-control col-md-7 col-xs-12">
  139. <datalist id="pcode">
  140. <?php
  141. while($row= mysqli_fetch_array($mlink))
  142. {
  143. ?>
  144. <option value="<?php echo $row ['productcode']; ?>"> <?php } ?>
  145. </datalist>
  146.  
  147. </div>
  148. <div class="form-group">
  149. <label for="Credits">Credits</label>
  150. <input type="number" class="form-control" id="credits" placeholder="Enter Credits Here" name="nqty" required ="required">
  151. </div>
  152. <div class="form-group">
  153. <label>Notes</label>
  154. <textarea class="form-control" rows="3" name="notes"></textarea>
  155. </div>
  156.  
  157. </div>
  158. <!-- /.box-body -->
  159.  
  160. <div class="box-footer">
  161. <button type="submit" class="btn btn-primary">Submit</button>
  162. </div>
  163. </form>
  164. </div>
  165. <!-- /.box -->
  166.  
  167. </section>
  168.  
  169. <!-- /.content -->
  170. </div>
  171. <!-- /.content-wrapper -->
  172.  
  173. <!-- Main Footer -->
  174. <?php include_once "footer.php"; ?>
  175.  
  176. <!-- Control Sidebar -->
  177. <aside class="control-sidebar control-sidebar-dark">
  178. <!-- Create the tabs -->
  179. <ul class="nav nav-tabs nav-justified control-sidebar-tabs">
  180. <li class="active"><a href="#control-sidebar-home-tab" data-toggle="tab"><i class="fa fa-home"></i></a></li>
  181. <li><a href="#control-sidebar-settings-tab" data-toggle="tab"><i class="fa fa-gears"></i></a></li>
  182. </ul>
  183. <!-- Tab panes -->
  184. <div class="tab-content">
  185. <!-- Home tab content -->
  186. <div class="tab-pane active" id="control-sidebar-home-tab">
  187. <h3 class="control-sidebar-heading">Recent Activity</h3>
  188. <ul class="control-sidebar-menu">
  189. <li>
  190. <a href="javascript:;">
  191. <i class="menu-icon fa fa-birthday-cake bg-red"></i>
  192.  
  193. <div class="menu-info">
  194. <h4 class="control-sidebar-subheading">Langdon's Birthday</h4>
  195.  
  196. <p>Will be 23 on April 24th</p>
  197. </div>
  198. </a>
  199. </li>
  200. </ul>
  201. <!-- /.control-sidebar-menu -->
  202.  
  203. <h3 class="control-sidebar-heading">Tasks Progress</h3>
  204. <ul class="control-sidebar-menu">
  205. <li>
  206. <a href="javascript:;">
  207. <h4 class="control-sidebar-subheading">
  208. Custom Template Design
  209. <span class="pull-right-container">
  210. <span class="label label-danger pull-right">70%</span>
  211. </span>
  212. </h4>
  213.  
  214. <div class="progress progress-xxs">
  215. <div class="progress-bar progress-bar-danger" style="width: 70%"></div>
  216. </div>
  217. </a>
  218. </li>
  219. </ul>
  220. <!-- /.control-sidebar-menu -->
  221.  
  222. </div>
  223. <!-- /.tab-pane -->
  224. <!-- Stats tab content -->
  225. <div class="tab-pane" id="control-sidebar-stats-tab">Stats Tab Content</div>
  226. <!-- /.tab-pane -->
  227. <!-- Settings tab content -->
  228. <div class="tab-pane" id="control-sidebar-settings-tab">
  229. <form method="post">
  230. <h3 class="control-sidebar-heading">General Settings</h3>
  231.  
  232. <div class="form-group">
  233. <label class="control-sidebar-subheading">
  234. Report panel usage
  235. <input type="checkbox" class="pull-right" checked>
  236. </label>
  237.  
  238. <p>
  239. Some information about this general settings option
  240. </p>
  241. </div>
  242. <!-- /.form-group -->
  243. </form>
  244. </div>
  245. <!-- /.tab-pane -->
  246. </div>
  247. </aside>
  248. <!-- /.control-sidebar -->
  249. <!-- Add the sidebar's background. This div must be placed
  250. immediately after the control sidebar -->
  251. <div class="control-sidebar-bg"></div>
  252. </div>
  253. <!-- ./wrapper -->
  254.  
  255. <!-- REQUIRED JS SCRIPTS -->
  256.  
  257. <!-- jQuery 2.2.3 -->
  258. <script src="plugins/jQuery/jquery-2.2.3.min.js"></script>
  259. <!-- Bootstrap 3.3.6 -->
  260. <script src="bootstrap/js/bootstrap.min.js"></script>
  261. <!-- AdminLTE App -->
  262. <script src="dist/js/app.min.js"></script>
  263.  
  264. <!-- Optionally, you can add Slimscroll and FastClick plugins.
  265. Both of these plugins are recommended to enhance the
  266. user experience. Slimscroll is required when using the
  267. fixed layout. -->
  268. </body>
  269. </html>
Advertisement
Add Comment
Please, Sign In to add comment