<!DOCTYPE html>
<html lang="en">
<?php include_once("config.php"); ?>
<head>
       <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
	<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="white">
<meta name="apple-mobile-web-app-title" content="Notentool">
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
	<link rel="manifest" href="manifest.json">
	
	
    <title>RONAHI</title>
<script src="myscripts.js"></script>
    <!-- Stylesheet File -->
    <link rel="stylesheet" href="assets/css/vendor.css">
    <link rel="stylesheet" href="assets/css/style.css">
    <link rel="stylesheet" href="assets/css/responsive.css">
	
	<style>
	@import url(http://fonts.googleapis.com/earlyaccess/droidarabickufi.css);
	body,h5,h6 {
font-family: 'Droid Arabic Kufi', sans-serif;
}
	

	
	
	</style>
</head>

<body   onload="adeb();" >

    <!-- preloader area start -->
    <div class="preloader" id="preloader">
        <div class="preloader-inner">
            <div class="spinner">
                <div class="dot1"></div>
                <div class="dot2"></div>
            </div>
        </div>
    </div>
    <!-- preloader area end -->

 

    <!-- header start -->
    <div class="header-area" style="background-image: url(assets/img/bg/1.png);">
        <div class="container">
            <div class="row">
                <div class="col-sm-4 col-3">
                    <div class="menu-bar">
                        <i class="fa fa-bars"></i>
                    </div>
                </div>
                <div class="col-sm-4 col-4 text-center">
                    <a href="index.php" class="logo">
                        <img src="assets/img/logo.png" alt="logo">
                    </a>
                </div>
                <div class="col-sm-4 col-5 text-right">
                    <ul class="header-right">
                        <li>
                            <a href="index.php">
                                <i class="fa fa-envelope"></i>
                                
                            </a>
                        </li>
                        <li>
                            <a href="index.php">
                                <i class="fa fa-bell animated infinite swing"></i>
                               
                            </a>
                        </li>
                       
                    </ul>
                </div>
            </div>
        </div>
    </div>
    <!-- header end -->

    <!-- navbar end -->
    <div class="ba-navbar">
        <div class="ba-navbar-user">
            <div class="menu-close">
                <i class="la la-times"></i>
            </div>
            <div class="thumb">
                <img src="assets/img/user.png" alt="user">
            </div>
            <div class="details">
                <h5>RONAHI</h5>
             
            </div>
        </div>
        <div class="ba-add-balance-title">
        سیسته‌می تۆماری گاز
                
               
        </div>
        
        <div class="ba-main-menu">
            <h5>Menu</h5>
            <ul>
                <li><a href="index.php">به‌رده‌ڕه‌ش</a></li>
                <li><a href="rovia.php">رۆڤیا</a></li>
                <li><a href="gawelan.php">گه‌ویلان</a></li>
                <li><a href="daratu.php">داره‌توو</a></li>

            </ul>
        
        </div>
    </div>
    <!-- navbar end -->





    <!-- add balance start -->
	
	
 
 
    <div class="add-balance-area pd-top-40">
        <div class="container">
            <div class="ba-add-balance-title ba-add-balance-btn">
                <h5 style="text-align:center;">سیسته‌می تۆماری گاز</h5>
               
            </div>
            <div class="ba-add-balance-inner mg-top-20">
                <div class="row custom-gutters-20">
                    <div class="col-6">
                        <a class="btn btn-blue ba-add-balance-btn" href="index.php">به‌رده‌ڕه‌ش<i class="fa fa-align-center"></i></a>
                    </div>
                    <div class="col-6">
                        <a class="btn btn-red ba-add-balance-btn" href="daratu.php">داره‌توو <i class="fa fa-align-center"></i></a>
                    </div>
                    <div class="col-6">
                        <a class="btn btn-purple ba-add-balance-btn" href="gawelan.php">گه‌ویلان <i class="fa fa-align-center "></i></a>
                    </div>
                    <div class="col-6">
                        <a class="btn btn-green ba-add-balance-btn" href="rovia.php">رۆڤیا <i class="fa fa-align-center "></i></a>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- add balance End -->

    <!-- goal area Start -->
    <div class="goal-area pd-top-36">
        <div class="container">
      <div class="alert bg-gradient-03 no-border" role="alert" style="text-align: center;">
                                <strong>گه‌ویلان</strong>
                            </div>
		   <?php

    $slct1 = @$_POST['slct1'];
    $sm_mtr = @$_POST['sm_mtr'];
    $slct2 = @$_POST['slct2'];
    $letar = @$_POST['letar'];
    $location_name = @$_POST['location_name'];

    

  if (isset($_POST['insert'])) {
  if (empty($sm_mtr)) {
	  
	  
  echo '<div class="alert alert-danger alert-dissmissible fade show" role="alert" style="text-align: center;">
                                <button type="button" class="close" data-dismiss="alert" aria-label="Close"></button>
                                <strong >هه‌ڵه‌!</strong> تكایه‌ خانه‌ی سم مه‌تر پڕ بكه‌وه‌ 
                            </div>';
  }
  else {
	  
	
    $insertc = mysqli_query($con, "INSERT INTO tomar (mauqh,sm_mtr,tang_def,letar,location_name) VALUES ('$slct1','$sm_mtr','$slct2','$letar','$location_name')");
    if (isset($insertc)) {

    }
	echo'<div class="alert alert-success alert-dissmissible fade show" role="alert" style="text-align: center;">
                                <button type="button" class="close" data-dismiss="alert" aria-label="Close"></button>
                                <strong>تۆماربوون</strong>   سه‌ركه‌توو تۆمار بوون
                            </div>';
  }

}

 ?>
			
		    <div class="signin-area">
        <div class="container">
            <form class="contact-form-inner"  style="text-align: right;" action=""  method="post" >
             
                  <select  class="form-control custom-select" name="slct1" id="slct1" onchange="populate(this.id,'slct2')" style="text-align:center;font-size: 18px;">
                  <option value="">--هه‌لبژێره‌--</option>
                                            <option value="ابو فرهاد">ابو فرهاد</option>
                                            <option value="ابو رونی">ابو رونی</option>
                                            <option value="ابو محمود">ابو محمود</option>
											                                      
                                        </select>
                <label class="single-input-wrap">
                    <span>سم</span>
                    <input type="number"  name="sm_mtr" style="text-align: center; font-size: 21px;" id="smt" value="" onchange="adeb();">
                    <span>قیاسی هه‌ر سم مێك</span>

			<select class="form-control custom-select"  style="text-align: center; font-size: 21px;color:red;" name="slct2" id="slct2" onchange="adeb();"></select>
	
					
                 
                </label>
                <label class="single-input-wrap">
                    <span>لتر</span>
                    <input type="number" name="letar" style="text-align:center;font-size: 21px;" id="total">
                </label>
                <input type="hidden" value="گه‌ویلان"  name="location_name">
                  <button type="insert" class="btn-c btn-success mr-1 mb-2" name="insert"><i class="la la-add"></i>زيادكردن</button>
             

			 
            </form>
        </div>
    </div>
					     <script>

	
function populate(s1,s2)
		{
			var s1 = document.getElementById(s1);
			var s2 = document.getElementById(s2);

			s2.innerHTML = "";

			if(s1.value == "ابو فرهاد")
			{
				var optionArray = ['60|60'];
			}
			else if(s1.value  == 'ابو رونی')
			{
				var optionArray = ['60|60'];
			}
            else if(s1.value  == 'ابو محمود')
			{
				var optionArray = ['70|70'];
			}

           


			for(var option in optionArray)
			{
				var pair = optionArray[option].split("|");
				var newoption = document.createElement("option");

				newoption.value = pair[0];
				newoption.innerHTML=pair[1];
				s2.options.add(newoption);
			}




		}

        function adeb(){
            var smt=document.getElementById("smt").value;
var slct2=document.getElementById("slct2").value;
var total=parseFloat(smt)*parseFloat(slct2);
document.getElementById("total") .value = total;
}

	   </script>
           
            


    <!-- blog-area start -->

    <div class="footer-area">
	 <div class="container">
            <div class="footer-bottom text-center "style="bottom: 30px; font-size: 30px;">
                <ul>
                    <li>
                        <a href="index.php">
                            <i class="fa fa-home"></i>
                            <p>سه‌ره‌تا</p>
                        </a>
                    </li>
                    <li>
                        <a href="components-table.php">
                            <i class="fa fa-file-text"></i>
                            <p>تۆمار</p>
                        </a>
                    </li>
                  
                    <li>
                        <a class="menu-bar" href="#">
                            <i class="fa fa-bars"></i>
                            <p>لیست</p>
                        </a>
                    </li>
                  
                </ul>
            </div>
        </div>
    
    </div>

    <!-- back to top area start -->
    <div class="back-to-top">
        <span class="back-top"><i class="fa fa-angle-up"></i></span>
    </div>
    <!-- back to top area end -->

    <!-- All Js File here -->
    <script src="assets/js/vendor.js"></script>
    <script src="assets/js/main.js"></script>

</body>

</html>