commit e67df7f4643faed1306b31f3856351926ed1b60e Author: Kar l5 Date: Sat Jun 8 14:27:55 2024 +0530 init diff --git a/119/.htaccess b/119/.htaccess new file mode 100644 index 0000000..8a409b7 --- /dev/null +++ b/119/.htaccess @@ -0,0 +1,8 @@ +RewriteEngine On +#RewriteCond %{HTTPS} !=on +#RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE] +RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC] +RewriteRule ^(.*)$ https://%1/$1 [R=301,L] +RewriteCond %{REQUEST_FILENAME} !-f +RewriteCond %{REQUEST_FILENAME} !-d +RewriteRule ^(.*) index.php diff --git a/119/_404.php b/119/_404.php new file mode 100644 index 0000000..57db2e9 --- /dev/null +++ b/119/_404.php @@ -0,0 +1 @@ +404 \ No newline at end of file diff --git a/119/_footer.php b/119/_footer.php new file mode 100644 index 0000000..95b3ef0 --- /dev/null +++ b/119/_footer.php @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/119/_header.php b/119/_header.php new file mode 100644 index 0000000..ff01324 --- /dev/null +++ b/119/_header.php @@ -0,0 +1,3 @@ +
+ +
\ No newline at end of file diff --git a/119/_home.php b/119/_home.php new file mode 100644 index 0000000..4f2ba46 --- /dev/null +++ b/119/_home.php @@ -0,0 +1,61 @@ +
+
+
+
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+
+
+ + + +
+
+
+
+
+ +Barcode:'; +echo ''.$barcodeText.''; +} else { +echo '
Enter product name or number to generate barcode!
'; +} +} +?> \ No newline at end of file diff --git a/119/_navbar.php b/119/_navbar.php new file mode 100644 index 0000000..4be0e25 --- /dev/null +++ b/119/_navbar.php @@ -0,0 +1,226 @@ +real_escape_string($_SESSION['email']); + $query = "SELECT * FROM `" . SHOP_ID . "_user` WHERE `email` = '$email'"; + $result = $link->query($query); + if ($result) {while ($row = $result->fetch_assoc()) {$user_email = $row['email'];}} else {echo "Error: " . $link->error;} + $link->close(); +?> + + + + + + + diff --git a/119/assets/ave_logo.png b/119/assets/ave_logo.png new file mode 100644 index 0000000..bcafff3 Binary files /dev/null and b/119/assets/ave_logo.png differ diff --git a/119/assets/logo.png b/119/assets/logo.png new file mode 100644 index 0000000..3150b1b Binary files /dev/null and b/119/assets/logo.png differ diff --git a/119/assets/mgm_logo.jpg b/119/assets/mgm_logo.jpg new file mode 100644 index 0000000..861e533 Binary files /dev/null and b/119/assets/mgm_logo.jpg differ diff --git a/119/assets/mgm_logo2.png b/119/assets/mgm_logo2.png new file mode 100644 index 0000000..f3a598a Binary files /dev/null and b/119/assets/mgm_logo2.png differ diff --git a/119/barcode.php b/119/barcode.php new file mode 100644 index 0000000..b62899a --- /dev/null +++ b/119/barcode.php @@ -0,0 +1,153 @@ + + */ + +// For demonstration purposes, get pararameters that are passed in through $_GET or set to the default value +$filepath = (isset($_GET["filepath"])?$_GET["filepath"]:""); +$text = (isset($_GET["text"])?$_GET["text"]:"0"); +$size = (isset($_GET["size"])?$_GET["size"]:"20"); +$orientation = (isset($_GET["orientation"])?$_GET["orientation"]:"horizontal"); +$code_type = (isset($_GET["codetype"])?$_GET["codetype"]:"code128"); +$print = (isset($_GET["print"])&&$_GET["print"]=='true'?true:false); +$sizefactor = (isset($_GET["sizefactor"])?$_GET["sizefactor"]:"1"); + +// This function call can be copied into your project and can be made from anywhere in your code +barcode( $filepath, $text, $size, $orientation, $code_type, $print, $sizefactor ); + +function barcode( $filepath="", $text="0", $size="20", $orientation="horizontal", $code_type="code128", $print=false, $SizeFactor=1 ) { + $code_string = ""; + // Translate the $text into barcode the correct $code_type + if ( in_array(strtolower($code_type), array("code128", "code128b")) ) { + $chksum = 104; + // Must not change order of array elements as the checksum depends on the array's key to validate final code + $code_array = array(" "=>"212222","!"=>"222122","\""=>"222221","#"=>"121223","$"=>"121322","%"=>"131222","&"=>"122213","'"=>"122312","("=>"132212",")"=>"221213","*"=>"221312","+"=>"231212",","=>"112232","-"=>"122132","."=>"122231","/"=>"113222","0"=>"123122","1"=>"123221","2"=>"223211","3"=>"221132","4"=>"221231","5"=>"213212","6"=>"223112","7"=>"312131","8"=>"311222","9"=>"321122",":"=>"321221",";"=>"312212","<"=>"322112","="=>"322211",">"=>"212123","?"=>"212321","@"=>"232121","A"=>"111323","B"=>"131123","C"=>"131321","D"=>"112313","E"=>"132113","F"=>"132311","G"=>"211313","H"=>"231113","I"=>"231311","J"=>"112133","K"=>"112331","L"=>"132131","M"=>"113123","N"=>"113321","O"=>"133121","P"=>"313121","Q"=>"211331","R"=>"231131","S"=>"213113","T"=>"213311","U"=>"213131","V"=>"311123","W"=>"311321","X"=>"331121","Y"=>"312113","Z"=>"312311","["=>"332111","\\"=>"314111","]"=>"221411","^"=>"431111","_"=>"111224","\`"=>"111422","a"=>"121124","b"=>"121421","c"=>"141122","d"=>"141221","e"=>"112214","f"=>"112412","g"=>"122114","h"=>"122411","i"=>"142112","j"=>"142211","k"=>"241211","l"=>"221114","m"=>"413111","n"=>"241112","o"=>"134111","p"=>"111242","q"=>"121142","r"=>"121241","s"=>"114212","t"=>"124112","u"=>"124211","v"=>"411212","w"=>"421112","x"=>"421211","y"=>"212141","z"=>"214121","{"=>"412121","|"=>"111143","}"=>"111341","~"=>"131141","DEL"=>"114113","FNC 3"=>"114311","FNC 2"=>"411113","SHIFT"=>"411311","CODE C"=>"113141","FNC 4"=>"114131","CODE A"=>"311141","FNC 1"=>"411131","Start A"=>"211412","Start B"=>"211214","Start C"=>"211232","Stop"=>"2331112"); + $code_keys = array_keys($code_array); + $code_values = array_flip($code_keys); + for ( $X = 1; $X <= strlen($text); $X++ ) { + $activeKey = substr( $text, ($X-1), 1); + $code_string .= $code_array[$activeKey]; + $chksum=($chksum + ($code_values[$activeKey] * $X)); + } + $code_string .= $code_array[$code_keys[($chksum - (intval($chksum / 103) * 103))]]; + + $code_string = "211214" . $code_string . "2331112"; + } elseif ( strtolower($code_type) == "code128a" ) { + $chksum = 103; + $text = strtoupper($text); // Code 128A doesn't support lower case + // Must not change order of array elements as the checksum depends on the array's key to validate final code + $code_array = array(" "=>"212222","!"=>"222122","\""=>"222221","#"=>"121223","$"=>"121322","%"=>"131222","&"=>"122213","'"=>"122312","("=>"132212",")"=>"221213","*"=>"221312","+"=>"231212",","=>"112232","-"=>"122132","."=>"122231","/"=>"113222","0"=>"123122","1"=>"123221","2"=>"223211","3"=>"221132","4"=>"221231","5"=>"213212","6"=>"223112","7"=>"312131","8"=>"311222","9"=>"321122",":"=>"321221",";"=>"312212","<"=>"322112","="=>"322211",">"=>"212123","?"=>"212321","@"=>"232121","A"=>"111323","B"=>"131123","C"=>"131321","D"=>"112313","E"=>"132113","F"=>"132311","G"=>"211313","H"=>"231113","I"=>"231311","J"=>"112133","K"=>"112331","L"=>"132131","M"=>"113123","N"=>"113321","O"=>"133121","P"=>"313121","Q"=>"211331","R"=>"231131","S"=>"213113","T"=>"213311","U"=>"213131","V"=>"311123","W"=>"311321","X"=>"331121","Y"=>"312113","Z"=>"312311","["=>"332111","\\"=>"314111","]"=>"221411","^"=>"431111","_"=>"111224","NUL"=>"111422","SOH"=>"121124","STX"=>"121421","ETX"=>"141122","EOT"=>"141221","ENQ"=>"112214","ACK"=>"112412","BEL"=>"122114","BS"=>"122411","HT"=>"142112","LF"=>"142211","VT"=>"241211","FF"=>"221114","CR"=>"413111","SO"=>"241112","SI"=>"134111","DLE"=>"111242","DC1"=>"121142","DC2"=>"121241","DC3"=>"114212","DC4"=>"124112","NAK"=>"124211","SYN"=>"411212","ETB"=>"421112","CAN"=>"421211","EM"=>"212141","SUB"=>"214121","ESC"=>"412121","FS"=>"111143","GS"=>"111341","RS"=>"131141","US"=>"114113","FNC 3"=>"114311","FNC 2"=>"411113","SHIFT"=>"411311","CODE C"=>"113141","CODE B"=>"114131","FNC 4"=>"311141","FNC 1"=>"411131","Start A"=>"211412","Start B"=>"211214","Start C"=>"211232","Stop"=>"2331112"); + $code_keys = array_keys($code_array); + $code_values = array_flip($code_keys); + for ( $X = 1; $X <= strlen($text); $X++ ) { + $activeKey = substr( $text, ($X-1), 1); + $code_string .= $code_array[$activeKey]; + $chksum=($chksum + ($code_values[$activeKey] * $X)); + } + $code_string .= $code_array[$code_keys[($chksum - (intval($chksum / 103) * 103))]]; + + $code_string = "211412" . $code_string . "2331112"; + } elseif ( strtolower($code_type) == "code39" ) { + $code_array = array("0"=>"111221211","1"=>"211211112","2"=>"112211112","3"=>"212211111","4"=>"111221112","5"=>"211221111","6"=>"112221111","7"=>"111211212","8"=>"211211211","9"=>"112211211","A"=>"211112112","B"=>"112112112","C"=>"212112111","D"=>"111122112","E"=>"211122111","F"=>"112122111","G"=>"111112212","H"=>"211112211","I"=>"112112211","J"=>"111122211","K"=>"211111122","L"=>"112111122","M"=>"212111121","N"=>"111121122","O"=>"211121121","P"=>"112121121","Q"=>"111111222","R"=>"211111221","S"=>"112111221","T"=>"111121221","U"=>"221111112","V"=>"122111112","W"=>"222111111","X"=>"121121112","Y"=>"221121111","Z"=>"122121111","-"=>"121111212","."=>"221111211"," "=>"122111211","$"=>"121212111","/"=>"121211121","+"=>"121112121","%"=>"111212121","*"=>"121121211"); + + // Convert to uppercase + $upper_text = strtoupper($text); + + for ( $X = 1; $X<=strlen($upper_text); $X++ ) { + $code_string .= $code_array[substr( $upper_text, ($X-1), 1)] . "1"; + } + + $code_string = "1211212111" . $code_string . "121121211"; + } elseif ( strtolower($code_type) == "code25" ) { + $code_array1 = array("1","2","3","4","5","6","7","8","9","0"); + $code_array2 = array("3-1-1-1-3","1-3-1-1-3","3-3-1-1-1","1-1-3-1-3","3-1-3-1-1","1-3-3-1-1","1-1-1-3-3","3-1-1-3-1","1-3-1-3-1","1-1-3-3-1"); + + for ( $X = 1; $X <= strlen($text); $X++ ) { + for ( $Y = 0; $Y < count($code_array1); $Y++ ) { + if ( substr($text, ($X-1), 1) == $code_array1[$Y] ) + $temp[$X] = $code_array2[$Y]; + } + } + + for ( $X=1; $X<=strlen($text); $X+=2 ) { + if ( isset($temp[$X]) && isset($temp[($X + 1)]) ) { + $temp1 = explode( "-", $temp[$X] ); + $temp2 = explode( "-", $temp[($X + 1)] ); + for ( $Y = 0; $Y < count($temp1); $Y++ ) + $code_string .= $temp1[$Y] . $temp2[$Y]; + } + } + + $code_string = "1111" . $code_string . "311"; + } elseif ( strtolower($code_type) == "codabar" ) { + $code_array1 = array("1","2","3","4","5","6","7","8","9","0","-","$",":","/",".","+","A","B","C","D"); + $code_array2 = array("1111221","1112112","2211111","1121121","2111121","1211112","1211211","1221111","2112111","1111122","1112211","1122111","2111212","2121112","2121211","1121212","1122121","1212112","1112122","1112221"); + + // Convert to uppercase + $upper_text = strtoupper($text); + + for ( $X = 1; $X<=strlen($upper_text); $X++ ) { + for ( $Y = 0; $Y \ No newline at end of file diff --git a/119/bill.php b/119/bill.php new file mode 100644 index 0000000..ea1f10f --- /dev/null +++ b/119/bill.php @@ -0,0 +1,109 @@ +set_charset("utf8"); + $query="INSERT INTO `".SHOP_ID."_customer` ( `phone`,`name`,`address`)VALUES(?,?,?)"; + $stmt = $link->prepare($query); + if($stmt){ + $stmt->bind_param("sss", $_POST['phone'],$_POST['name'],$_POST['address'] ); + //if(!$stmt->execute()) echo '
' . mysqli_error($link) . '
'; + if(!$stmt->execute()) echo '
' . mysqli_error($link) . '
'; + else { + echo '
customer: '.$_POST['name'].' added

+
+

+

+ + +
+ + '; + // . + } + } + else echo mysqli_error($link); + $link->close(); + +} +if(isset($_GET['phone'])){ + if($_GET['phone']==""){ + echo '
'; + } + else { + $link = new mysqli(MYSQL_HOST,MYSQL_USER,MYSQL_PASS,MYSQL_DB); + $query="SELECT * FROM `".SHOP_ID."_customer` WHERE `phone`='".$_GET['phone']."'"; + $result= mysqli_query($link, $query); + if(mysqli_num_rows($result)<1){ + echo 'New Customer:
+
+

+

+ + +
+ '; + } + else { + $row = $result -> fetch_array(MYSQLI_ASSOC); + // var_dump($row); + echo 'New Customer:
+
+

+

+ + +
+ '; + } + + echo ' +

+ + '; + + } + +} +else { +?> + + +

+
+Mobile : + +
+ + + + diff --git a/119/change-password.php b/119/change-password.php new file mode 100644 index 0000000..d23ea9e --- /dev/null +++ b/119/change-password.php @@ -0,0 +1,27 @@ +setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); + + $sql = "UPDATE `".SHOP_ID."_user` SET `pass`=? WHERE `email`=?"; + $stmt = $pdo->prepare($sql); + $stmt->execute([md5($_POST['pass']), $_SESSION['email']]); + + echo "Password updated successfully"; + } catch(PDOException $e) { + echo "Error updating record: " . $e->getMessage(); + } +} + + +?> +
+
+
+ + + +
+
+
\ No newline at end of file diff --git a/119/config/_config.php b/119/config/_config.php new file mode 100644 index 0000000..c36e62b --- /dev/null +++ b/119/config/_config.php @@ -0,0 +1 @@ + +
+

+
+ +
+
+ +
+
+ +

+
+ + +
+
+ +
+
+ + + + + +set_charset("utf8"); + $query="INSERT INTO `".SHOP_ID."_product` ( `name`, `hsn`, `mrp`,`price`,`cost`,`stock`,`cat`,`user`)VALUES(?,?,?,?,?,?,?,?)"; + $stmt = $link->prepare($query); + if($stmt){ + $stmt->bind_param("ssssssss", $_POST['name'],$_POST['hsn'],$_POST['mrp'],$_POST['price'],$_POST['cost'],$_POST['stock'],$_POST['cat'], $_SESSION["id"] ); + //if(!$stmt->execute()) echo '
' . mysqli_error($link) . '
'; + if(!$stmt->execute()) echo '
' . mysqli_error($link) . '
'; + else { + echo '
Product: '.$_POST['name'].' added with bar-code

'; + } + } + else echo mysqli_error($link); + $link->close(); + } + +?> \ No newline at end of file diff --git a/119/create-category.php b/119/create-category.php new file mode 100644 index 0000000..798dd19 --- /dev/null +++ b/119/create-category.php @@ -0,0 +1,56 @@ +
+
+
+
+
+ +
+ +
+ +
+ +set_charset("utf8"); + $query="INSERT INTO `".SHOP_ID."_cat` ( `category`)VALUES(?)"; + $stmt = $link->prepare($query); + if($stmt){ + $stmt->bind_param("s", $_POST['category'] ); + //if(!$stmt->execute()) echo '
' . mysqli_error($link) . '
'; + if(!$stmt->execute()) echo '
' . mysqli_error($link) . '
'; + else { + + echo '
'.$_POST['category'].' added as a new category

'; + } + } + else echo mysqli_error($link); + + + + $link->close(); + + + } + // $stmt = $link->prepare("INSERT INTO ".MYSQL_TB13." (`batch`, `std_name`, `tchr_name`)VALUES(?,?,?)"); + // if($stmt){ + // $stmt->bind_param("sss", $batch,$student,$teacher); + // //if(!$stmt->execute()) echo '
' . mysqli_error($link) . '
'; + // if(!$stmt->execute()) echo '
' . mysqli_error($link) . '
'; + // else { + // echo '
Student Register Successfull

Add Another'; + // } + // } + // else echo mysqli_error($link); + + + + // $link->close(); + + // } + + + ?> diff --git a/119/create_bill.php b/119/create_bill.php new file mode 100644 index 0000000..6678920 --- /dev/null +++ b/119/create_bill.php @@ -0,0 +1,184 @@ +set_charset("utf8"); + $query="UPDATE `".SHOP_ID."_product` SET `stock` = `stock` +1 WHERE `id`='".$_POST['product_id']."'"; + if($conn->query($query) === TRUE){ + $sql = "DELETE FROM `".SHOP_ID."_bill_product` WHERE `id` = '".$_POST['remove_item_from_bill']."'"; + if ($conn->query($sql) === TRUE) { + echo "Removed from Bill no: ".$_GET['bill'].",(this bill) and added to stock."; + } else { + echo "Error deleting record: " . $conn->error; + } + } + $conn->close(); +} +if(isset($_POST['phone'])){ + // echo strlen($_POST['phone']);exit(); + if(strlen($_POST['phone']) >4) $name=$_POST['name']; else $name='0'; + $link = new mysqli(MYSQL_HOST,MYSQL_USER,MYSQL_PASS,MYSQL_DB); + $link->set_charset("utf8"); + $started=1; + $query="INSERT INTO `".SHOP_ID."_bill` ( `status`,`cust_phone`,`cust_name`)VALUES(?,?,?)"; + $stmt = $link->prepare($query); + if($stmt){ + $stmt->bind_param("sss", $started,$_POST['phone'],$name ); + //if(!$stmt->execute()) echo '
' . mysqli_error($link) . '
'; + if(!$stmt->execute()) echo '
' . mysqli_error($link) . '
'; + else { + $last_id = $link->insert_id; + echo '
'.$last_id .'Bill Started

+ + '; + } + } + else echo mysqli_error($link); + $link->close(); +} +elseif(isset($_GET['bill'])){ + // echo $_GET['bill']; + echo '
'; + + + if(isset($_POST['code'])){ + $code = explode('-', $_POST['code']); // get the product id #$code[0] + $link = new mysqli(MYSQL_HOST,MYSQL_USER,MYSQL_PASS,MYSQL_DB); + $query="SELECT * FROM `".SHOP_ID."_product` WHERE `id`='".$code[0]."'"; + $result= mysqli_query($link, $query); + if(mysqli_num_rows($result)<1){ + echo '

Err: no Product Found

'; + } + else { + $row = $result -> fetch_array(MYSQLI_ASSOC); + if($row['stock']<1) echo '

Err: out of stock

'; + else { + $link = new mysqli(MYSQL_HOST,MYSQL_USER,MYSQL_PASS,MYSQL_DB); + $link->set_charset("utf8"); + $query="UPDATE `".SHOP_ID."_product` SET `stock` = `stock` -1 WHERE `id`='".$code[0]."'"; + if($link->query($query) === TRUE){ + $query="INSERT INTO `".SHOP_ID."_bill_product` ( `bill_id`,`product_id`,`mrp`,`price`,`cost`,`product_name`, `hsn`)VALUES(?,?,?,?,?,?,?)"; + $stmt = $link->prepare($query); + if($stmt){ + $stmt->bind_param("sssssss", $_GET['bill'],$code[0],$row['mrp'],$row['price'],$row['cost'],$row['name'],$row['hsn'] ); echo $row['mrp'],$row['price']; + //if(!$stmt->execute()) echo '
' . mysqli_error($link) . '
'; + if(!$stmt->execute()) echo '
ERR: 8776' . mysqli_error($link) . '
'; + // else { + // $last_id = $link->insert_id; + // echo '
'.$last_id .'Bill Started

+ // '; + // } + } + else echo mysqli_error($link); + } + $link->close(); + } + } + } + if(isset($_POST['payment_mode'])){ + //echo $_POST['payment_mode']; + $conn = new mysqli(MYSQL_HOST,MYSQL_USER,MYSQL_PASS,MYSQL_DB); + $sql = "UPDATE `".SHOP_ID."_bill` SET `payment_mode` = '".$_POST['payment_mode']."' , `total` = '".$_POST['bill_total']."' , `cost` = '".$_POST['bill_total_cost']."' WHERE `id` = '".$_POST['bill_no']."'"; + if ($conn->query($sql) === TRUE) { + echo "Bill Saved!"; + } else { + echo "Error updating record: " . $conn->error; + } + $conn->close(); + } + + +} +?> +
+Bill No: setTimestamp($timestamp); //adjust the object to correct timestamp +echo $_GET['bill'], ", ",$dt->format('Y/m/d h:i:sa'); + +//echo $_GET['bill'], ", ",date("Y/m/d h:i:sa"); +?> +
+ + + + + + + + + + + + + + + +
SLProductPriceAction

+ + ' ; + echo 'Total:',$total; + // echo ' Print '; + ?> +

+ Payment Mode +
+ +
+ +
+ +
+ +

+ + + +
+ + query($sql); +if ($result->num_rows > 0) { + while($row = $result->fetch_assoc()) { + if($row["payment_mode"]!='0') echo ' Print '; + } +} else { + echo "ERR: 4499"; +} +$conn->close(); +?> + + + \ No newline at end of file diff --git a/119/delete-barcode.php b/119/delete-barcode.php new file mode 100644 index 0000000..2418609 --- /dev/null +++ b/119/delete-barcode.php @@ -0,0 +1,35 @@ +connect_error) { + die("Connection failed: " . $link->connect_error); +} + +foreach ($productIDs as $id) { + $query = "DELETE FROM `" . SHOP_ID . "_product` WHERE `id` = ?"; + $stmt = $link->prepare($query); + $stmt->bind_param("i", $id); + $stmt->execute(); + header("Location: ./view-product"); + $stmt->close(); +} + +$link->close(); + + + +?> + + + + + \ No newline at end of file diff --git a/119/edit-category.php b/119/edit-category.php new file mode 100644 index 0000000..55144ae --- /dev/null +++ b/119/edit-category.php @@ -0,0 +1,30 @@ +set_charset("utf8"); + $query="UPDATE `".SHOP_ID."_cat` SET `category`='".$_POST['category']."' WHERE `id`='".$_POST["id"]."'"; + // echo $query; + if (mysqli_query($link, $query)) { + echo "Record updated successfully. "; + } else { echo "Error updating record: " . mysqli_error($link); } + +} + +if(isset($_GET['category'])){ +$link = new mysqli(MYSQL_HOST,MYSQL_USER,MYSQL_PASS,MYSQL_DB); + $query="SELECT * FROM `".SHOP_ID."_cat` WHERE `id` ='".$_GET['category']."'"; + $result= mysqli_query($link, $query); + while ($row= mysqli_fetch_assoc($result)) { + ?> +
+
+
+ + +
+ +close(); +} +?> \ No newline at end of file diff --git a/119/edit-product-cost.php b/119/edit-product-cost.php new file mode 100644 index 0000000..f9e8bb8 --- /dev/null +++ b/119/edit-product-cost.php @@ -0,0 +1,133 @@ +setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); + + $sql = "UPDATE `".SHOP_ID."_product` SET `name`=?, `hsn`=?, `mrp`=?, `price`=?, `stock`=?, `user`=?, `cost`=? WHERE `id`=?"; + $stmt = $pdo->prepare($sql); + $stmt->execute([$_POST['pname'], $_POST['hsn'], $_POST['mrp'], $_POST['price'], $_POST['stock'], $_SESSION["id"], $_POST["cost"], $_POST["id"]]); + + echo "Record updated successfully, go to stock to verify."; + // echo ''; + } catch(PDOException $e) { + echo "Error updating record: " . $e->getMessage(); + } +} +// $sql = "UPDATE users SET name=?, surname=?, sex=? WHERE id=?"; +// $pdo->prepare($sql)->execute([$name, $surname, $sex, $id]); + + +// if(isset($_POST['id'])){ +// $link = mysqli_connect(MYSQL_HOST,MYSQL_USER,MYSQL_PASS,MYSQL_DB); +// $link->set_charset("utf8"); +// $query="UPDATE `".SHOP_ID."_product` SET `name`='".$_POST['pname']."', `hsn`='".$_POST['hsn']."', `mrp`='".$_POST['mrp']."' , `price`='".$_POST['price']."' , `stock`='".$_POST['stock']."' , `user`='".$_SESSION["id"]."', `cost`='".$_POST["cost"]."' WHERE `id`='".$_POST["id"]."'"; + +// if (mysqli_query($link, $query)) { + +// echo "Record updated successfully, go to stock to verify."; +// } else { +// echo "Error updating record: " . mysqli_error($link); +// } +// // $stmt = $link->prepare($query); +// // if($stmt){ +// // $stmt->bind_param("ssssss",$_POST['mrp'],$_POST['price'],$_POST['stock'],$_POST['cat'], $_SESSION["id"],$_POST['id'] ); +// // //if(!$stmt->execute()) echo '
' . mysqli_error($link) . '
'; +// // if(!$stmt->execute()) echo '
' . mysqli_error($link) . '
'; +// // else { +// // echo '
Product: '.$_POST['name'].' Edited

'; +// // } +// // } +// // else echo mysqli_error($link); +// // $link->close(); +// } + + ?> + +

Err: no Product Found

+ '; + } + else { + $row= mysqli_fetch_assoc($result); + // echo $row['name']; + echo ' +
+

+ +
+ +
+
+ +
+
'; + if(isset($_SESSION['email']) && $_SESSION['email']=='mousumi@fashionavenueonline.com'){ + echo '
'; + } + + echo ' +
+ + +
+
+ +
+
+ '; + } + } +?> + + + diff --git a/119/edit-product.php b/119/edit-product.php new file mode 100644 index 0000000..f7f4dc8 --- /dev/null +++ b/119/edit-product.php @@ -0,0 +1,102 @@ +setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); + + $sql = "UPDATE `".SHOP_ID."_product` SET `name`=?, `hsn`=?, `mrp`=?, `price`=?, `stock`=?, `user`=?, `cost`=? WHERE `id`=?"; + $stmt = $pdo->prepare($sql); + $stmt->execute([$_POST['pname'], $_POST['hsn'], $_POST['mrp'], $_POST['price'], $_POST['stock'], $_SESSION["id"], $_POST["cost"], $_POST["id"]]); + + echo "Record updated successfully, go to stock to verify."; + // echo ''; + } catch(PDOException $e) { + echo "Error updating record: " . $e->getMessage(); + } +} + + ?> + +

Err: no Product Found

+ '; + } + else { + $row= mysqli_fetch_assoc($result); + // echo $row['name']; + echo ' +
+

+ +
+ +
+ + +
+ +
+
+ +
+ + +
+
+ +
+
+ '; + } + } +?> + + + diff --git a/119/index.php b/119/index.php new file mode 100644 index 0000000..0639f1f --- /dev/null +++ b/119/index.php @@ -0,0 +1,18 @@ +FD=",F_D,"
lnk=",$lnk,"
"; //phpinfo(); +$url = explode('/', $_SERVER['REQUEST_URI']); +if(isset($url[1])) { $lnk=$url[2]; $lnk2 = explode('?', $lnk); } +include("config/_config.php"); +include("_header.php"); + +// echo $lnk.".php"; +if( (isset($_SESSION['email'])) && ($_SESSION['shop']==SHOP_ID)) { + include("_navbar.php"); + + if($lnk=="" || $lnk=="index" || $lnk=="index.php" || $lnk=="_home.php" || $lnk2[0]=="") include("_home.php"); + elseif(file_exists(__DIR__."/".$lnk.".php")) include($lnk.".php"); + elseif(isset($lnk2[1]) && file_exists(__DIR__."/".$lnk2[0].".php") ) include($lnk2[0].".php"); + else include("_404.php"); +} else include("login.php"); + + +include("_footer.php"); diff --git a/119/info.txt b/119/info.txt new file mode 100644 index 0000000..71ea683 --- /dev/null +++ b/119/info.txt @@ -0,0 +1,3 @@ +DB------ +bill -> status | 1= bill status initieated, 2=bill saved +bill -> payment_mode | 0=default value (not paid) diff --git a/119/login.php b/119/login.php new file mode 100644 index 0000000..df1d97b --- /dev/null +++ b/119/login.php @@ -0,0 +1,77 @@ +set_charset("utf8"); + $email=$_POST['email']; + $password=md5($_POST['pass']); + $sql = "SELECT * FROM `".SHOP_ID."_user` WHERE `email`=? AND `pass`=?"; + $stmt= $link->prepare($sql); + $stmt->bind_param("ss",$email,$password); + $stmt->execute(); + $result= $stmt->get_result(); + + // print_r($result); + // exit; + $row = $result->fetch_assoc(); + if ($result->num_rows == 1){ + + $_SESSION["loggedin"] = true; $_SESSION["shop"] = SHOP_ID; $_SESSION["name"] = $row["name"]; $_SESSION["id"] = $row["id"];$_SESSION["email"] = $row["email"]; //var_dump($_SESSION); + echo ''; + + //echo"Yes"; + } + else echo "credentials did not match"; + $link->close(); + } + + + + ?> + + + + + + + + + + + + + + + diff --git a/119/print-barcode.php b/119/print-barcode.php new file mode 100644 index 0000000..9decea8 --- /dev/null +++ b/119/print-barcode.php @@ -0,0 +1,86 @@ +
+connect_error) { + die("Connection failed: " . $link->connect_error); +} +foreach ($productIDs as $id) { + $query = "SELECT * FROM `" . SHOP_ID . "_product` WHERE `id` = ?"; + $stmt = $link->prepare($query); + $stmt->bind_param("i", $id); + + $stmt->execute(); + $result = $stmt->get_result(); + if ($result->num_rows > 0) { + while ($row = $result->fetch_assoc()) { + for ($i = 0; $i < $row['stock']; $i++) { + echo '

'.$row['name'].'

Price:'.$row['price'].'

'; + } + // echo ' Price:'.$row['mrp'].''; +?> + +JsBarcode(\"#code".$row['id']."\", \"" . $row['id'] .'-' .$row['cat']. "\", {width: 1.4, height: 30, displayValue: true, fontSize: 10});"; + } + } else { + echo "No product found with ID: " . $id . "
"; + } + } + + $stmt->close(); + $link->close(); +?> +
+









































+
+ + + + + \ No newline at end of file diff --git a/119/print-bill.php b/119/print-bill.php new file mode 100644 index 0000000..19187d6 --- /dev/null +++ b/119/print-bill.php @@ -0,0 +1,262 @@ + 4) + $name = $_POST['name']; + else + $name = '0'; + $link = new mysqli(MYSQL_HOST, MYSQL_USER, MYSQL_PASS, MYSQL_DB); + $link->set_charset("utf8"); + $started = 1; + $query = "INSERT INTO `" . SHOP_ID . "_bill` ( `status`,`cust_phone`,`cust_name`)VALUES(?,?,?)"; + $stmt = $link->prepare($query); + if ($stmt) { + $stmt->bind_param("sss", $started, $_POST['phone'], $name); + //if(!$stmt->execute()) echo '
' . mysqli_error($link) . '
'; + if (!$stmt->execute()) + echo '
' . mysqli_error($link) . '
'; + else { + $last_id = $link->insert_id; + echo '
' . $last_id . 'Bill Started

+ + '; + } + } else + echo mysqli_error($link); + $link->close(); +} elseif (isset ($_GET['bill'])) { + // echo $_GET['bill']; + //echo '
'; + + + if (isset ($_POST['code'])) { + // if(isset($url[1])) { $lnk=$url[2]; $lnk2 = explode('?', $lnk); } + $code = explode('-', $_POST['code']); + // echo $code[1]; + $link = new mysqli(MYSQL_HOST, MYSQL_USER, MYSQL_PASS, MYSQL_DB); + $query = "SELECT * FROM `" . SHOP_ID . "_product` WHERE `id`='" . $code[0] . "'"; + $result = mysqli_query($link, $query); + if (mysqli_num_rows($result) < 1) { + echo '
+

Err: no Product Found

+ '; + } else { + $row = $result->fetch_array(MYSQLI_ASSOC); + // var_dump($row); + if ($row['stock'] < 1) + echo '

Err: out of stock

'; + else { + $link = new mysqli(MYSQL_HOST, MYSQL_USER, MYSQL_PASS, MYSQL_DB); + $link->set_charset("utf8"); + $query = "INSERT INTO `" . SHOP_ID . "_bill_product` ( `bill_id`,`product_id`,`price`,`product_name`)VALUES(?,?,?,?)"; + $stmt = $link->prepare($query); + if ($stmt) { + $stmt->bind_param("ssss", $_GET['bill'], $code[1], $row['price'], $row['name']); + //if(!$stmt->execute()) echo '
' . mysqli_error($link) . '
'; + if (!$stmt->execute()) + echo '
Err' . mysqli_error($link) . '
'; + // else { + // $last_id = $link->insert_id; + // echo '
'.$last_id .'Bill Started

+ // '; + // } + } else + echo mysqli_error($link); + $link->close(); + + } + + } + } + +} +?> +
+ + + +
+

MGM Enterprises

+ +
+ GST: 19AJSPB8539J1ZJ + + 16/120/57, Golbazar, Ashoknagar, Habra, 743222 + +91 9907218172 + Fashion Avenue + Bill No: +real_escape_string($_GET['bill']); + $query = "SELECT * FROM `" . SHOP_ID . "_bill` WHERE `id` = '$bill_id'"; + $result = $link->query($query); + + if ($result) { + if ($row = $result->fetch_assoc()) { + $billing_date = $row['time']; + $tz = 'Asia/Kolkata'; + $billing_dt = new DateTime($billing_date, new DateTimeZone('UTC')); + $print_dt = new DateTime("now", new DateTimeZone($tz)); + echo "", $_GET['bill'], ", ", $billing_dt->format('Y/m/d h:i:sa'); + + } else { + echo "No results found."; + } + } else { + echo "Error: " . $link->error; + } + + $link->close(); +?> + + +
+ + + + + + + + + + = 1000) { + $GSTPercentage = 112; + } else { + //Future Billing Amount Conditions + } + + $GSTAmount = round($row['price'] / $GSTPercentage * 100); + $totalTax = $totalTax + $row['price'] - $GSTAmount; + $totalPrice = $totalPrice + $GSTAmount; + // echo $GSTAmount; + + // $withGST = round($row['price'] + $GSTAmount); + ?> + + + + + + + + +
SLProductGSTPriceTotal
+ + + HSN: ', $row['hsn']; + if($row['returned']=='1'){ + echo '
(Exchanged) '; + $totalReturn=$totalReturn+$row['price']; + } + // if ($row['mrp'] > $row['price']) { $discount = $row['mrp'] - $row['price']; } + ?> +
+ + + + + +
+
+ + ' ; + + // echo ' Print '; + ?> +
+

Total Tax:

+

+
+ SGST:  + , + + CGST:  + + +

+

+
+
+ + + + + + +
G. Total:
+
+
+ + 0) echo + '
+ + + + + + +
Total Return:'.$totalReturn.'
+
+
' ; ?> + +

Conditions:

+ • Items sold cannot be returned but exchanged within 5 + days from purchase (Time 12:00 to 15:00) + • To exchange, original bill and price tag must be + intact. + • Accessories and undergarments cannot be + exchanged.
+ Thank You for shopping with us
Authorised Signatory
+

Bill Print Date: format('Y-m-d H:i:s');?>

+ +


+
+ + + \ No newline at end of file diff --git a/119/return.php b/119/return.php new file mode 100644 index 0000000..50ea6ad --- /dev/null +++ b/119/return.php @@ -0,0 +1,207 @@ +query($sql) === TRUE) { + //echo "Bill Saved!"; + } else { + echo "Error updating record: " . $conn->error; + } + $conn->close(); + } + $link = new mysqli(MYSQL_HOST,MYSQL_USER,MYSQL_PASS,MYSQL_DB); + $query="SELECT * FROM `".SHOP_ID."_bill` WHERE `payment_mode` != 0 AND `id`='".$_GET['bill_numbber']."'"; + $result= mysqli_query($link, $query); + if(mysqli_num_rows($result)<1){ + echo '
+

Err: No Paid Bill found check the bill number.

+ '; + } + else { + if(isset($_POST['return_bill_id'])){ + $total= -1 * abs($_POST['total']); + $link = new mysqli(MYSQL_HOST,MYSQL_USER,MYSQL_PASS,MYSQL_DB); + $query="INSERT INTO `".SHOP_ID."_bill` ( `total`,`return_id`,`payment_mode`,`user`)VALUES(?,?,?,?)"; + $payment_mode='99'; + $stmt = $link->prepare($query); + if($stmt){ + $stmt->bind_param("ssss", $total,$_POST['return_bill_id'],$payment_mode,$_SESSION["id"] ); echo $total,$_POST['return_bill_id'],$_SESSION["id"] ; + //if(!$stmt->execute()) echo '
' . mysqli_error($link) . '
'; + if(!$stmt->execute()) echo '
ERR: 8776' . mysqli_error($link) . '
'; + } + else echo mysqli_error($link); + } + if(isset($_POST['return_product_id'])){ + $link = new mysqli(MYSQL_HOST,MYSQL_USER,MYSQL_PASS,MYSQL_DB); + $query="UPDATE `".SHOP_ID."_product` SET `stock` = `stock` +1 WHERE `id`='".$_POST['product_id']."'"; + if($link->query($query) === TRUE){ + $query="UPDATE `".SHOP_ID."_bill_product` SET `returned` = '1' WHERE `id`='".$_POST['return_product_id']."'"; + $result= mysqli_query($link, $query); + if($result) echo 'Returned!'; else echo 'Err:44889'; + } + } + echo '
+
'; + $sl=0; + $total=0;$total_cost=0; + $link = new mysqli(MYSQL_HOST,MYSQL_USER,MYSQL_PASS,MYSQL_DB); + $query="SELECT * FROM `".SHOP_ID."_bill_product` WHERE `bill_id`='".$_GET['bill_numbber']."' ORDER BY `id` DESC"; + $result= mysqli_query($link, $query); + while ($row= mysqli_fetch_assoc($result)) { + $sl++;$total=$total+$row['price']; $total_cost=$total_cost+$row['cost']; + echo ''; + } + echo '
SL Product MRP Price Action
',$sl,' ',$row['product_name'],' ',$row['mrp'],' ',$row['price'],' '; + if($row['returned']=='1') echo 'Returned'; else echo '
+ +
'; + echo '


'; + $tz = 'Asia/Kolkata';$timestamp = time();$dt = new DateTime("now", new DateTimeZone($tz));$dt->setTimestamp($timestamp); + echo ' +
+ + Return #'.$_GET['bill_numbber'],' - ',$dt->format('Y/m/d h:i:sa'); + echo ' '; + $sl=0; + $total_return=0; + $link = new mysqli(MYSQL_HOST,MYSQL_USER,MYSQL_PASS,MYSQL_DB); + $query="SELECT * FROM `".SHOP_ID."_bill_product` WHERE `returned`='1' AND `bill_id`='".$_GET['bill_numbber']."' ORDER BY `id` DESC"; + $result= mysqli_query($link, $query); + while ($row= mysqli_fetch_assoc($result)) { + $sl++;$total_return=$total_return+$row['price']; + echo ''; + } + echo '
SL Product Price
',$sl,' ',$row['product_name'],' ',$row['price'],'

Total Return: ',$total_return,'
'; + if($total_return>0){ + $link = new mysqli(MYSQL_HOST,MYSQL_USER,MYSQL_PASS,MYSQL_DB); + $query="SELECT * FROM `".SHOP_ID."_bill` WHERE `return_id`='".$_GET['bill_numbber']."'"; //echo $query; + $result= mysqli_query($link, $query); + if(mysqli_num_rows($result)>0){ + $row= mysqli_fetch_assoc($result); $newBill_id = $row['id']; $payment_mode= $row['payment_mode']; + + // Start new bill Section starts + // if(isset($newBill_id)){ + // echo '
'; + // } + + // Start new bill Section ends + + + if(isset($_POST['code'])){ + $code = explode('-', $_POST['code']); // get the product id #$code[0] + $link = new mysqli(MYSQL_HOST,MYSQL_USER,MYSQL_PASS,MYSQL_DB); + $query="SELECT * FROM `".SHOP_ID."_product` WHERE `id`='".$code[0]."'"; + $result= mysqli_query($link, $query); + if(mysqli_num_rows($result)<1){ + echo '

Err: no Product Found

'; + } + else { + $row = $result -> fetch_array(MYSQLI_ASSOC); + if($row['stock']<1) echo '

Err: out of stock

'; + else { + $link = new mysqli(MYSQL_HOST,MYSQL_USER,MYSQL_PASS,MYSQL_DB); + $link->set_charset("utf8"); + $query="UPDATE `".SHOP_ID."_product` SET `stock` = `stock` -1 WHERE `id`='".$code[0]."'"; + if($link->query($query) === TRUE){ + $query="INSERT INTO `".SHOP_ID."_bill_product` ( `bill_id`,`product_id`,`mrp`,`price`,`cost`,`product_name`)VALUES(?,?,?,?,?,?)"; + $stmt = $link->prepare($query); + if($stmt){ + $stmt->bind_param("ssssss", $newBill_id,$code[0],$row['mrp'],$row['price'],$row['cost'],$row['name'] );// echo $row['mrp'],$row['price']; + //if(!$stmt->execute()) echo '
' . mysqli_error($link) . '
'; + if(!$stmt->execute()) echo '
ERR: 8776' . mysqli_error($link) . '
'; + // else { + // $last_id = $link->insert_id; + // echo '
'.$last_id .'Bill Started

+ // '; + // } + } + else echo mysqli_error($link); + } + $link->close(); + } + } + } + +#$tz = 'Asia/Kolkata';$timestamp = time();$dt = new DateTime("now", new DateTimeZone($tz));$dt->setTimestamp($timestamp); +echo "Bill #: ",$newBill_id,' +
+ + + + + + '; + $sl=0; + $total=0; + $link = new mysqli(MYSQL_HOST,MYSQL_USER,MYSQL_PASS,MYSQL_DB); + $query="SELECT * FROM `".SHOP_ID."_bill_product` WHERE `bill_id`='".$newBill_id."' ".$returned." ORDER BY `id` DESC"; + $result= mysqli_query($link, $query); + while ($row= mysqli_fetch_assoc($result)) { + $sl++;$total=$total+$row['price']; + echo ' + + '; + } + $Payable=$total-$total_return; + echo '
SLProductPrice
',$sl,'',$row['product_name']; + if($row['mrp']> $row['price']) {$discount=$row['mrp']- $row['price']; echo '
@ ', $row['mrp'], ', Discount: ',$discount;} + echo '
',$row['price'],'

Total Billed: ',$total,', Payable: ',$Payable,''; + +if($payment_mode=='99'){ +echo '
'; + if($total<$total_return) echo '
Add more item'; + else echo ' + Payment Mode +
+ +
+ +
+ +
+ +

+ + + +
+ '; +} else echo '
'; + + //echo '
go to return section to print '; + } + else echo 'Total Return: ',$total_return,'
+

'; + + } + + + } + } + else echo ' +
+
+ + +
+ '; + +echo '
'; +?> + \ No newline at end of file diff --git a/119/signout.php b/119/signout.php new file mode 100644 index 0000000..977747c --- /dev/null +++ b/119/signout.php @@ -0,0 +1,8 @@ + +

Logout Success!

+echo ''; diff --git a/119/view-barcode-original.php b/119/view-barcode-original.php new file mode 100644 index 0000000..ca31bd9 --- /dev/null +++ b/119/view-barcode-original.php @@ -0,0 +1,72 @@ + +
+
+
+ + + + + +
+
+
+ +
+
+ + + + + '; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + } + ?> +
Rs: ',$row['mrp'],' Rs: ',$row['mrp'],' Rs: ',$row['mrp'],' Rs: ',$row['mrp'],' Rs: ',$row['mrp'],'
Rs: ',$row['mrp'],' Rs: ',$row['mrp'],' Rs: ',$row['mrp'],' Rs: ',$row['mrp'],' Rs: ',$row['mrp'],'
Rs: ',$row['mrp'],' Rs: ',$row['mrp'],' Rs: ',$row['mrp'],' Rs: ',$row['mrp'],' Rs: ',$row['mrp'],'
Rs: ',$row['mrp'],' Rs: ',$row['mrp'],' Rs: ',$row['mrp'],' Rs: ',$row['mrp'],' Rs: ',$row['mrp'],'
Rs: ',$row['mrp'],' Rs: ',$row['mrp'],' Rs: ',$row['mrp'],' Rs: ',$row['mrp'],' Rs: ',$row['mrp'],'
Rs: ',$row['mrp'],' Rs: ',$row['mrp'],' Rs: ',$row['mrp'],' Rs: ',$row['mrp'],' Rs: ',$row['mrp'],'
Rs: ',$row['mrp'],' Rs: ',$row['mrp'],' Rs: ',$row['mrp'],' Rs: ',$row['mrp'],' Rs: ',$row['mrp'],'
Rs: ',$row['mrp'],' Rs: ',$row['mrp'],' Rs: ',$row['mrp'],' Rs: ',$row['mrp'],' Rs: ',$row['mrp'],'
Rs: ',$row['mrp'],' Rs: ',$row['mrp'],' Rs: ',$row['mrp'],' Rs: ',$row['mrp'],' Rs: ',$row['mrp'],'
Rs: ',$row['mrp'],' Rs: ',$row['mrp'],' Rs: ',$row['mrp'],' Rs: ',$row['mrp'],' Rs: ',$row['mrp'],'
+
+ + + +
+
+
+ + + + + + \ No newline at end of file diff --git a/119/view-barcode.php b/119/view-barcode.php new file mode 100644 index 0000000..8335f72 --- /dev/null +++ b/119/view-barcode.php @@ -0,0 +1,121 @@ + + +
+
+
+ + + + + +
+
+
+ +
+
+ + + + +

' . $row['name'] . '

Price:' . $row['price'] . '

'; + echo ""; + } + } +} + + +?> + +
+
+
+
+

+
+

+
+

+
+

+
+

+
+

+
+

+
+

+
+

+
+

+
+
+ + +
+
+
+ + + + + + + \ No newline at end of file diff --git a/119/view-bills-cost.php b/119/view-bills-cost.php new file mode 100644 index 0000000..7432e30 --- /dev/null +++ b/119/view-bills-cost.php @@ -0,0 +1,88 @@ +
+ + + + + + + + + +
Cash Card UPI Other All Paid incomplete Bills
+
+
+ + Start Date Date Before + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
IDDatePhoneAmountNameAction
Print
Continue
Print
+ + Total Bill: ', $total , ', Cost: ', $total_cost , ', Profit: ', $total-$total_cost , ''; ?> \ No newline at end of file diff --git a/119/view-bills.php b/119/view-bills.php new file mode 100644 index 0000000..f41508b --- /dev/null +++ b/119/view-bills.php @@ -0,0 +1,288 @@ += 1000) { + $GSTPercentage = 112; + } else { + //Future Billing Amount Conditions + } + $GSTAmount = round($billRow['price'] / $GSTPercentage * 100); + $totalTax = $billRow['price'] - $GSTAmount; + $totalGST = $totalGST + $totalTax ; + + $totalAmount=$totalAmount+$billRow['price']; + $totalCost=$totalCost+$billRow['cost']; + } +// return $totalGST; +return array($totalGST,$totalCost,$totalAmount); +} + + +?> +
+ + + + + + + + + +
Cash Card UPI Other All Paid Incomplete Bills
+
+ + + Start Date Date Before + + + + + + + + + + + Action';} ?> + +setTimezone(new DateTimeZone('Asia/Kolkata')); + return $date->format('Y-m-d H:i:s'); +} +if(isset($_GET['payment'])){ + // echo date('Y-m-d', strtotime(' +1 day')); + $between="AND `time` between '".date('Y-m-d')."' AND '".date('Y-m-d', strtotime(' +1 day'))."'"; + //echo $_POST['start'],$_POST['end']; + if(isset($_POST['start'])){ + $between="AND `time` between '".$_POST['start']."' AND '".$_POST['end']."'"; //echo $between; + } + if($_GET['payment'] == 'paid') { + $link = new mysqli(MYSQL_HOST, MYSQL_USER, MYSQL_PASS, MYSQL_DB); + $GSTAmount =0; + $totalTax =0; + $totalGSTlistedBills=0; + $query = "SELECT * FROM `" . SHOP_ID . "_bill` WHERE `payment_mode` != '0' " . $between . " ORDER BY `id` DESC"; + $result = mysqli_query($link, $query); + while ($row = mysqli_fetch_assoc($result)) { + ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SLDatePhoneAmountGSTPAIDName
+
+ Print   ';} ?> + + + + +
+
Continue
+ Print   ';} ?> + + + + + + +
+
+ + + Total Bill: ', $total ; + if(isset($_SESSION['email']) && $_SESSION['email']=='mousumi@fashionavenueonline.com' || $_SESSION['email']=='user@fashionavenue.com'){ + echo ', Cost: ', $total_cost , ', Profit: ', $total-$total_cost,' Total GST: ', $totalGSTlistedBills ; + } + echo ''; ?> + + +query($sql) === TRUE) { + echo 'Bill ID'.$_POST['delete_bill'].' Removed.'; + echo ''; + } else { echo "Error deleting record: " . $conn->error; } + $conn->close(); + // sleep(1); + } + ?> + + diff --git a/119/view-category.php b/119/view-category.php new file mode 100644 index 0000000..dc6ce69 --- /dev/null +++ b/119/view-category.php @@ -0,0 +1,39 @@ + + + + + + +query($sql) === TRUE) { + echo "Category Removed."; + } else { echo "Error deleting record: " . $conn->error; } + $conn->close(); +} + $link = new mysqli(MYSQL_HOST,MYSQL_USER,MYSQL_PASS,MYSQL_DB); + $query="SELECT * FROM `".SHOP_ID."_cat` ORDER BY `id` DESC"; + $result= mysqli_query($link, $query); + while ($row= mysqli_fetch_assoc($result)) { + ?> + + + + + +close(); +?> +
IDcategory Action
+ + View items   + +   Edit   + +
+
+
\ No newline at end of file diff --git a/119/view-product copy.php b/119/view-product copy.php new file mode 100644 index 0000000..bcbb156 --- /dev/null +++ b/119/view-product copy.php @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + +
Bar CodeIDProductMRPDiscountPriceStockBarCodeAction
PrintEdit
+ diff --git a/119/view-product-by-category.php b/119/view-product-by-category.php new file mode 100644 index 0000000..af61329 --- /dev/null +++ b/119/view-product-by-category.php @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + +
IDProductMRPDiscountPriceStock
\ No newline at end of file diff --git a/119/view-product.php b/119/view-product.php new file mode 100644 index 0000000..5e228e1 --- /dev/null +++ b/119/view-product.php @@ -0,0 +1,110 @@ + + + + + + + Cost'; + } + ?> + + + + + + Action'; + } + ?> + + Bill Costing'; + // } + $link = new mysqli(MYSQL_HOST, MYSQL_USER, MYSQL_PASS, MYSQL_DB); + $query = "SELECT * FROM `" . SHOP_ID . "_product` ORDER BY `id` DESC"; + $result = mysqli_query($link, $query); + while ($row = mysqli_fetch_assoc($result)) { + ?> + + + + + + + + '.$row['cost'].''; + } + ?> + + + + + + Edit'; + } + ?> + + +
Bar CodeIDProduct NameHSNMRPDiscountPriceStockBarCode
+ + + Print

+
+
+ + +
+ +
+ + +
+ +
+ diff --git a/readme.txt b/readme.txt new file mode 100644 index 0000000..8d1c8b6 --- /dev/null +++ b/readme.txt @@ -0,0 +1 @@ +