booking/invoice_search.php

93 lines
3.0 KiB
PHP
Executable File

<?php
require_once('fixed/config/go_con.php');
access(15);
// if come with number
$number = $_GET['number'];
// if come with number end
?>
<!DOCTYPE html>
<html lang="en" dir="rtl">
<?php require_once('fixed/head/go.php'); ?>
<body class="rtl">
<style>
.header-title {
color: #086367 !important;
font-weight: bold !important;
}
</style>
<?php require_once('fixed/loader/go.php'); ?>
<div class="page-wrapper" id="pageWrapper">
<?php require_once('fixed/header/go.php'); ?>
<div class="page-body-wrapper">
<?php require_once('fixed/sidebar/go.php'); ?>
<div class="page-body">
<div class="container-fluid">
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-body new-user order-list">
<h6 class="mt-0 header-title">البحث</h6>
<div class="form-group row">
<div class="col-8 col-sm-6 col-lg-3 p-r-0">
<label for="" class="col-form-label text-right">رقم الفاتورة</label>
<input id="number" class="form-control clickfun1" type="text" value="<?php if(!empty($number)){echo $number;} ?>" required>
</div>
<div class="col-4 col-sm-6 col-lg-1 p-l-0">
<label style="visibility: hidden;" for="" class="col-form-label text-right">..</label>
<div class="form-control" style="background-color: #086367; color:white; text-align:center; cursor: pointer;" id="search_inv">بحث</div>
</div>
</div>
<div id="get_book">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php require_once('fixed/footer/go.php'); ?>
</div>
</div>
<div id="get_data"></div>
<?php require_once('fixed/js/go.php'); ?>
<script>
// for limit clicks
searchClick = 0;
$(function() {
$("#search_inv").click(function() {
search_inv();
});
});
$('.clickfun1').keypress(function (e) {
var key = e.which;
if(key == 13) {
search_inv();
}
});
function search_inv() {
var invNumber = $("#number").val();
if (invNumber.length <= 0 || invNumber == '') {
swalfun('حدث خطأ', 'يرجى كتابة رقم فانورة صحيح', 'error');
return false;
}
if (searchClick == 0) {
searchClick++;
$.post("work/order/ajax/search_invoice_ajax.php", {
invNumber,
}, function(get_inv) {
$("#get_book").html(get_inv);
})
} else {
swalfun("يرجى الانتظار","", "warning");
}
}
<?php
if(!empty($number)){echo 'search_inv()';}
?>
</script>
</body>
</html>