Advertisement
Guest User

Untitled

a guest
Jul 3rd, 2017
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.86 KB | None | 0 0
  1. <!DOCTYPE html>
  2.  
  3.  
  4. <html >
  5. <head>
  6. <meta charset="UTF-8">
  7. <title>Seza Admin Login</title>
  8.  
  9.  
  10.  
  11. <link rel="stylesheet" href="css/loginStyle.css">
  12.  
  13.  
  14.  
  15.  
  16. </head>
  17.  
  18. <body>
  19.  
  20.  
  21. <?php include("connection.php");
  22.  
  23. error_reporting(E_ALL);
  24.  
  25. $msg=null;
  26.  
  27.  
  28.  
  29. if(isset($_POST['login']) && $_POST['login']=='ok')
  30. {
  31. $username =$_POST['username'];
  32. $password = $_POST['password'];
  33.  
  34. $selectuser = mysqli_query($conn,"select * from admins where USERNAME='".$username."' and PASSWORD ='".$password."'") or die(mysqli_error($conn));
  35. $no_users = mysqli_num_rows($selectuser);
  36. if($no_users>0)
  37. {
  38. $fetch_user = mysqli_fetch_array($selectuser);
  39. $_SESSION['adminid']= $fetch_user['AID'];
  40.  
  41. alert("success");
  42. header("location:AdminDashboard.php");
  43.  
  44. }
  45. else{
  46. $msg = "The username or password is invalid";
  47. }
  48. }
  49. else{
  50. if(isset($_POST['login']) && $_POST['login']=='ok')
  51. {
  52. echo"invalid";
  53. }
  54. }
  55.  
  56.  
  57. ?>
  58. <div class="site_wrapper">
  59.  
  60.  
  61.  
  62.  
  63. <form method="post" id="additem-form" >
  64. <input type="hidden" id="login" name="login" value="ok" />
  65. <div class="login">
  66.  
  67. <div class="login-screen">
  68. <div class="app-title">
  69. <h1>SezaPharma</h1>
  70. <h3>ADMIN LOGIN</h3>
  71. </div>
  72.  
  73. <div class="login-form">
  74. <div class="control-group">
  75. <input type="text" class="login-field" value="" placeholder="username" id="username" name="username">
  76. <label class="login-field-icon fui-user" for="login-name"></label>
  77. </div>
  78.  
  79. <div class="control-group">
  80. <input type="password" class="login-field" value="" placeholder="password" id="password" name="password">
  81. <label class="login-field-icon fui-lock" for="login-pass"></label>
  82. </div>
  83.  
  84. <button class="btn btn-primary btn-large btn-block" type="submit" value="login" >login</button>
  85. <a class="login-link" onClick="alertRset()" href="">Lost ? Reset your password?</a>
  86.  
  87. <div style="color:#FF0004">
  88. <?php
  89. if(isset($msg) && $msg!="")
  90. { ?>
  91. <div class="alert-danger"><?php echo $msg; ?></div>
  92.  
  93. <?php }
  94.  
  95. ?></div>
  96. </div>
  97. </div>
  98. </div>
  99.  
  100. </form>
  101.  
  102.  
  103. <script>
  104. function alertRset() {
  105. var txt;
  106. if (confirm("It will Reset username and password to default.") == true) {
  107. window.close();
  108. window.open("resetadmin.php");
  109. } else {
  110. txt = "You pressed Cancel!";
  111. }
  112. document.getElementById("demo").innerHTML = txt;
  113. }
  114. </script>`enter code here`
  115. </body>
  116. </html>
  117.  
  118. <!DOCTYPE html>
  119.  
  120. <html>
  121. <head>
  122.  
  123. </style>
  124. </head>
  125. <body>
  126.  
  127. <?php include("connection.php");
  128. error_reporting(E_ALL);
  129.  
  130. if (isset($_SESSION['adminid'])) {
  131.  
  132. ?>
  133.  
  134. <div class="dashboard">
  135. <div class="tab">
  136. <button class="tablinks" onclick="openCity(event, 'London')" id="defaultOpen">All Products</button>
  137. <button class="tablinks" onclick="openCity(event, 'Paris')">Add New Product</button>
  138. <button class="tablinks" onclick="openCity(event, 'Tokyo')">Setting</button>
  139. <a href="logout.php" ><button class="tablinks" onclick="openCity(event, 'Tokyo')" >Loggout</button></a>
  140. </div>
  141.  
  142. <div id="London" class="tabcontent" style="overflow:auto">
  143.  
  144.  
  145. <div class="site_wrapper" >
  146.  
  147.  
  148.  
  149.  
  150. <div class="clearfix margin_top10"></div>
  151.  
  152.  
  153. <div class="works01" >
  154.  
  155. <div class="container" >
  156.  
  157.  
  158.  
  159. <div id="grid-container" class="cbp-l-grid-fullWidth" style="overflow:visible;">
  160.  
  161.  
  162. <?php
  163.  
  164.  
  165. $select_post=mysqli_query($conn,"select * from products ORDER BY PID desc") or die(mysqli_error());
  166.  
  167. while($post=mysqli_fetch_array($select_post))
  168. {
  169.  
  170. ?>
  171.  
  172. <div class="cbp-item <?php echo $post['PTYPE'];?>">
  173. <div class="cbp-caption">
  174. <div class="cbp-caption-defaultWrap">
  175. <img style="width:100%; height:200px;" src="UploadedImage/<?php echo $post['PIMAGELOC'];?>" alt="">
  176. </div>
  177. <div class="cbp-caption-activeWrap">
  178. <div class="cbp-l-caption-alignCenter">
  179. <div class="cbp-l-caption-body">
  180. <h3><?php echo $post['PNAME'];?></h3>
  181. <br />
  182. <a href="#" class="cbp-l-caption-buttonLeft">Edit</a>
  183. <a href="delete_product.php?PID=<?php echo $post['PID']; ?>" class="cbp-l-caption-buttonLeft" data-title="Looking Publishing <br>reasonable always">Delete</a>
  184. </div>
  185. </div>
  186. </div>
  187. </div>
  188. </div><!-- end item -->
  189.  
  190. <?php
  191. }
  192.  
  193. ?>
  194.  
  195.  
  196.  
  197.  
  198. </div>
  199.  
  200.  
  201.  
  202. </div>
  203. </div><!-- end works section -->
  204.  
  205.  
  206.  
  207.  
  208.  
  209.  
  210.  
  211.  
  212.  
  213.  
  214.  
  215.  
  216.  
  217. <a href="#" class="scrollup">Scroll</a><!-- end scroll to top of the page-->
  218.  
  219.  
  220.  
  221. </div>
  222.  
  223. </div>
  224. <div id="Paris" class="tabcontent">
  225. <form action="add_item.php" method="post" enctype="multipart/form-data" onsubmit="return validateForm()" id="additem-form" name="additem-form">
  226.  
  227. <div class="contactcontainer">
  228. <header>
  229. <h1>Add new Product</h1>
  230. </header>
  231. <table width="100%" align="center">
  232. <tr>
  233. <td colspan="2">
  234. <input style="width:74%" placeholder="Product Name" type="text" id="pname" name="pname">
  235. </td>
  236. </tr>
  237.  
  238. <tr>
  239. <td colspan="2">
  240. <select class="select" style=" width:74%;" name="cat" id="cat">
  241. <option value="Category" selected="selected">Product Category</option>
  242. <option value="livestock" > livestock Products</option>
  243. <option value="Poultry">Poultry Products</option>
  244.  
  245. </select>
  246. </td>
  247. </tr>
  248. <tr>
  249. <td colspan="2" >
  250. <div style="border:dashed; width:75%;" align="center">
  251. <h4>Choose Product Picture</h4>
  252. <input type="file" id="pimage" name="pimage" class="input-file" title="upload Photo / video" />
  253. </div>
  254. </td>
  255. </tr>
  256.  
  257. <tr>
  258. <td>
  259. <select class="select" style=" width:55%;" id="ptype" name="ptype">
  260. <option value="Type">Product Type</option>
  261. <option value="Injections">Injections</option>
  262. <option value="Anthilmentics">Anthilmentics</option>
  263. <option value="Natural">Natural Products</option>
  264. </select>
  265. </td>
  266. <td>
  267. <select class="select" id="availability" style=" width:55%;" name="availability">
  268. <option value="Availability">Availability</option>
  269. <option value="yes">Yes</option>
  270. <option value="no">No</option>
  271. </select>
  272. </td>
  273. </tr>
  274. <tr>
  275. <td colspan="2">
  276. <input style="width:74%" class="email" placeholder="Full Farmula with quantity" type="text" id="pfarmula" name="pfarmula">
  277. </td>
  278. </tr>
  279. <tr>
  280. <td colspan="2">
  281. <textarea style="width:74%" placeholder="Product Description" id="pdesc" name="pdesc"></textarea>
  282. </td>
  283. </tr>
  284. <tr>
  285. <td colspan="2" >
  286. <div style="width:74%" align="center">
  287. <footer>
  288. <button style="width:20%" id="addbtn" name="addbtn" >Add</button>
  289. </footer>
  290. </div>
  291. </td>
  292. </tr>
  293. </table>
  294. </div>
  295. </form>
  296.  
  297. </div>
  298.  
  299. <div id="Tokyo" class="tabcontent">
  300. <h3>Tokyo</h3>
  301. <p>Tokyo is the capital of Japan.</p>
  302. </div>
  303. </div> <!--end of tabs-->
  304.  
  305.  
  306. <script>
  307.  
  308.  
  309. function validateForm()
  310. {
  311. var a=document.forms["additem-form"]["availability"].value;
  312. var b=document.forms["additem-form"]["pname"].value;
  313. var c=document.forms["additem-form"]["cat"].value;
  314. var d=document.forms["additem-form"]["ptype"].value;
  315.  
  316. if (a=="Availability" || b=="" || c=="Category" || d=="Type")
  317. {
  318. alert("Please Fill All Required Field");
  319. return false;
  320. }
  321. }
  322.  
  323.  
  324.  
  325. function openCity(evt, cityName) {
  326. var i, tabcontent, tablinks;
  327. tabcontent = document.getElementsByClassName("tabcontent");
  328. for (i = 0; i < tabcontent.length; i++) {
  329. tabcontent[i].style.display = "none";
  330. }
  331. tablinks = document.getElementsByClassName("tablinks");
  332. for (i = 0; i < tablinks.length; i++) {
  333. tablinks[i].className = tablinks[i].className.replace(" active", "");
  334. }
  335. document.getElementById(cityName).style.display = "block";
  336. evt.currentTarget.className += " active";
  337. }
  338.  
  339. // Get the element with id="defaultOpen" and click on it
  340. document.getElementById("defaultOpen").click();
  341. </script>
  342.  
  343.  
  344.  
  345. <!-- ######### JS FILES ######### -->
  346. <!-- get jQuery used for the theme -->
  347. <script type="text/javascript" src="js/universal/jquery.js"></script>
  348. <script src="js/style-switcher/styleselector.js"></script>
  349. <script src="js/animations/js/animations.min.js" type="text/javascript"></script>
  350. <script src="js/mainmenu/bootstrap.min.js"></script>
  351. <script src="js/mainmenu/customeUI.js"></script>
  352. <script src="js/scrolltotop/totop.js" type="text/javascript"></script>
  353. <script type="text/javascript" src="js/mainmenu/sticky.js"></script>
  354. <script type="text/javascript" src="js/mainmenu/modernizr.custom.75180.js"></script>
  355. <script type="text/javascript" src="js/cubeportfolio/jquery.cubeportfolio.min.js"></script>
  356. <script type="text/javascript" src="js/cubeportfolio/main31.js"></script>
  357.  
  358. <?php } else{ echo " You mus Loggedin to acces this page"; } ?>
  359. </body>
  360. </html>
  361.  
  362. <?php
  363.  
  364. session_start();
  365. // Create connection
  366. $conn = mysqli_connect("localhost", "username","password", "sezaphar_sezapharmadb") or die($conn->connect_error);
  367.  
  368. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement