001.
<meta http-equiv=Content-Type content=
"text/html; charset=utf-8"
>
002.
<?php
003.
require_once
(
"dbconnect.php"
);
004.
require_once
(
"pagination_function.php"
);
005.
006.
session_name(
'LoginForm'
);
007.
@session_start();
008.
009.
error_reporting
(0);
010.
include
(
"config.php"
);
011.
012.
$suser
=
$_SESSION
[
'user_info'
][
'id'
] ;
013.
$ssu
=
$_SESSION
[
'user_info'
][
'levels'
] ;
014.
015.
016.
if
(
$ssu
==
""
)
017.
{
018.
header(
"location: index.php"
);
019.
exit
(0);
020.
}
021.
022.
?>
024.
<style type=
"text/css"
>
025.
html{
026.
font-family:tahoma, Arial,
"Times New Roman"
;
027.
font-size:14px;
028.
}
029.
body{
030.
font-family:tahoma, Arial,
"Times New Roman"
;
031.
font-size:14px;
032.
}
033.
.margin_top_5{
034.
margin-top: 5px;
035.
}
036.
</style>
037.
038.
039.
040.
<div
class
=
"table-responsive-sm"
>
041.
042.
<table
class
=
"table table-bordered table-striped table-hover table-sm"
>
043.
<thead >
044.
<tr
class
=
"table-primary"
>
045.
<th
class
=
"text-left"
scope=
"col"
>
Date
</th>
046.
<th
class
=
"text-left"
scope=
"col"
>Stock Sale</th>
047.
<th
class
=
"text-left"
scope=
"col"
>Stock inventory</th>
048.
</tr>
049.
</thead>
050.
<tbody>
051.
<?php
052.
053.
054.
$num
= 0;
055.
056.
057.
$sql
= "
058.
SELECT *, sum(allqualitys)
as
sumPQ FROM tb_orders WHERE 1
059.
";
060.
061.
062.
$result
=
$mysqli
->query(
$sql
);
063.
$total
=
$result
->num_rows;
064.
065.
$e_page
=30;
066.
$step_num
=0;
067.
if
(!isset(
$_GET
[
'page'
]) || (isset(
$_GET
[
'page'
]) &&
$_GET
[
'page'
]==1)){
068.
$_GET
[
'page'
]=1;
069.
$step_num
=0;
070.
$s_page
= 0;
071.
}
else
{
072.
$s_page
=
$_GET
[
'page'
]-1;
073.
$step_num
=
$_GET
[
'page'
]-1;
074.
$s_page
=
$s_page
*
$e_page
;
075.
}
076.
$sql
.=
" GROUP BY ordates ORDER BY ID DESC LIMIT "
.
$s_page
.
",$e_page"
;
077.
$result
=
$mysqli
->query(
$sql
);
078.
if
(
$result
&&
$result
->num_rows>0){
079.
while
(
$row
=
$result
->fetch_assoc()){
080.
$num
++;
081.
?>
082.
<tr>
083.
<td
class
=
"text-left"
><?=
$row
[
'ordates'
]?></td>
084.
<td
class
=
"text-left"
><?=
$row
[
'sumPQ'
]?></td>
085.
<td
class
=
"text-left"
><?
086.
087.
$con
= mysqli_connect(
'localhost'
,
'cp603386_addwara'
,
'jaya2554'
,
'cp603386_orderwara'
);
088.
089.
090.
091.
092.
$query
=
"SELECT *, sum(pur_num) as sumPPQ from tb_purchese GROUP BY pur_product "
;
093.
094.
$exec
= mysqli_query(
$con
,
$query
);
095.
while
(
$rows
= mysqli_fetch_array(
$exec
)){
096.
097.
098.
$ap
=
$rows
[
'sumPPQ'
];
099.
$pp
=
$row
[
'sumPQ'
] ;
100.
$aapp
=
$ap
-
$pp
;
101.
echo
"$aapp"
;
102.
}
103.
104.
?></td>
105.
106.
</tr>
107.
<?php
108.
}
109.
}
110.
?>
111.
</tbody>
112.
</table>
113.
114.
115.
</div>
116.
117.
118.
<script language=
"JavaScript"
>
119.
function
ClickCheckAll(vol)
120.
{
121.
122.
var
i=1;
123.
for
(i=1;i<=document.frmMain.hdnCount.value;i++)
124.
{
125.
if
(vol.checked == true)
126.
{
127.
eval
(
"document.frmMain.chkprint"
+i+
".checked=true"
);
128.
}
129.
else
130.
{
131.
eval
(
"document.frmMain.chkprint"
+i+
".checked=false"
);
132.
}
133.
}
134.
}
135.
</script>
136.
137.
140.
<script type=
"text/javascript"
>
141.
$(
function
(){
142.
143.
});
144.
</script>