Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion admin/addfactor.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
</tr>

<tr>
<td class="top">مبلغ</td>
<td class="top">مبلغ(تومان)</td>
<td><input type="text" value="" name="price" required/></td>
</tr>

Expand Down
2 changes: 1 addition & 1 deletion admin/factoredit.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
</tr>

<tr>
<td class="top">مبلغ</td>
<td class="top">مبلغ(تومان)</td>
<td><input type="text" value="' . $zng_price . '" name="price" required/></td>
</tr>

Expand Down
2 changes: 1 addition & 1 deletion admin/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<td class="top" style="text-align: center;">بابت</td>
<td class="top" style="text-align: center;">تاریخ ایجاد</td>
<td class="top" style="text-align: center;">مهلت پرداخت ( تا )</td>
<td class="top" style="text-align: center;">قیمت</td>
<td class="top" style="text-align: center;">قیمت(تومان)</td>
<td class="top" style="text-align: center;">توضیحات</td>
<td class="top" style="text-align: center;">وضعیت</td>
<td class="top" style="text-align: center;">کد تراکنش</td>
Expand Down
4 changes: 2 additions & 2 deletions admin/login.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
include("../app/core.php");
include("../app/config.php");


if($_POST['username']=="admin") {//edited 1401/12/18
$note ='';
if(isset($_POST['username']) && $_POST['username']==="admin") {//edited 1401/12/18

$query = "SELECT * FROM zng_system WHERE ID =1";//edited 1401/12/18
$zng_fg = mysqli_query($zng_info_data, $query);//edited 1401/12/18
Expand Down
28 changes: 23 additions & 5 deletions app/config.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,33 @@
<?php
session_start();
/*
* configurations & settings
*/
$mydir='zf'; //main folder
$ZarinGate=false;
$SandBox=true; // true is for test mode. change it to false
//Database Info
$zng_sql_address = "localhost"; //Default is localhost
$zng_sql_username = "root"; //Your Database's username
$zng_sql_password = ""; //Your Database's password
$zng_sql_name = "zng"; //Your Database's name

/**
* end of configurations
*/
if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on')
$url = "https://";
else
$url = "http://";
// Append the host(domain name, ip) to the URL.
$url.= $_SERVER['HTTP_HOST'];

if (session_status() == PHP_SESSION_NONE) {
session_start();
}
//-----------------------
mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);//edited 1401/12/18 Ali
$zng_info_data = mysqli_connect($zng_sql_address, $zng_sql_username,$zng_sql_password, $zng_sql_name );//edited 1401/12/18 Ali

mysqli_query($zng_info_data, "SET NAMES utf8");
$query = "SELECT * FROM zng_system WHERE ID =1";//edited 1401/12/18 Ali
$result = mysqli_query($zng_info_data, $query);//edited 1401/12/18 Ali

Expand All @@ -30,7 +48,7 @@
//JDF
$zng_date = jdate('o/n/j','','','','en');
$zng_date_compare = jdate('onj','','','','en');
$ZarinGate=false;
$SandBox=true;


//*************
$query_update_webadress="UPDATE `zng_system` SET `webaddress` = '".$url."/".$mydir."/' WHERE `zng_system`.`ID` = 1";
$result = mysqli_query($zng_info_data, $query_update_webadress);//edited 1401/12/18 Ali
3 changes: 2 additions & 1 deletion app/core.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,11 @@
}

mysqli_select_db( $zng_con,$zng_sql_name);//edited 1401/12/18 Ali
mysqli_query($zng_info_data, "SET NAMES utf8");

//Theme Header & Footer
function zng_header() {
include("config.php");
//include("config.php");

include("app/page/zng_header.php");
}
Expand Down
2 changes: 2 additions & 0 deletions app/page/gateway/request.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,15 @@
$MerchantID = $zng_zarinpal_mc; //Required
$Amount = $zng_price; //Amount will be based on Toman - Required
$Description = 'پرداخت فاکتور شماره:' . $zng_id; // Required
//exit('<p>'.$Description.'</p>');
$Email = $_POST['u_email']; // Optional
$Mobile = $_POST['u_phone']; // Optional
$u_info_array = array("u_email"=>$_POST['u_email'],"u_phone"=>$_POST['u_phone']);
$u_info_json = json_encode($u_info_array);
$u_info_base = base64_encode($u_info_json);
$CallbackURL = $zng_web_address . '?index=verify&id=' . $_POST['id'] . '&u_info=' . $u_info_base; // Required

// exit('<p>'.$CallbackURL.'</p>');
// URL also Can be https://ir.zarinpal.com/pg/services/WebGate/wsdl

$zp = new zarinpal();
Expand Down
1 change: 0 additions & 1 deletion app/page/gateway/verify.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

include("app/config.php");
require_once("zarinpal_function.php");
//Factor Get
Expand Down
3 changes: 3 additions & 0 deletions app/page/zng_header.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
<?php
include("app/config.php");
?>
<html dir="rtl" lang="fa">
<head>
<meta charset="utf-8"/>
Expand Down
3 changes: 2 additions & 1 deletion app/page/zng_idpay.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@

}

if($zng_status=="paid" && $_GET['ref']!="") {
// if($zng_status=="paid" && $_GET['ref']!="") {
if($zng_status=="paid" && $zng_ref !="") {
echo '
<div class="note" id="paid">با تشکر از پرداخت شما. فاکتور شما به حالت پرداخت شده تغییر داده شد و اطلاعات شما ثبت شد. جهت پیگیری های بعدی کد تراکنش زیر را یادداشت:<br>' . $zng_ref . '</div>
';
Expand Down
50 changes: 25 additions & 25 deletions zng.sql
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
-- phpMyAdmin SQL Dump
-- version 5.2.0
-- version 5.2.1
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Mar 12, 2023 at 06:23 AM
-- Server version: 10.4.27-MariaDB
-- PHP Version: 8.0.25
-- Host: 127.0.0.1
-- Generation Time: Apr 15, 2023 at 03:52 AM
-- Server version: 10.4.28-MariaDB
-- PHP Version: 8.2.4

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
Expand All @@ -29,26 +29,26 @@ SET time_zone = "+00:00";

CREATE TABLE `zng_factor` (
`ID` int(11) NOT NULL,
`from` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`to` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`for` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`createdate` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`paytime` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`price` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`description` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`status` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`ref` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '',
`email` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '',
`phone` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT ''
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
`from` varchar(1000) NOT NULL,
`to` varchar(1000) NOT NULL,
`for` varchar(1000) NOT NULL,
`createdate` varchar(1000) NOT NULL,
`paytime` varchar(1000) NOT NULL,
`price` varchar(1000) NOT NULL,
`description` varchar(1000) NOT NULL,
`status` varchar(1000) NOT NULL,
`ref` varchar(1000) NOT NULL,
`email` varchar(1000) NOT NULL,
`phone` varchar(1000) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `zng_factor`
--

INSERT INTO `zng_factor` (`ID`, `from`, `to`, `for`, `createdate`, `paytime`, `price`, `description`, `status`, `ref`, `email`, `phone`) VALUES
(110, '&#1605;&#1583;&#1740;&#1585; &#1587;&#1575;&#1740;&#1578;', '&#1576;&#1585;&#1606;&#1575;&#1605;&#1607; &#1606;&#1608;&#1740;&#1587; &#1605;&#1606;&#1578;&#1588;&#1585; &#1705;&#1606;&#1606;&#1583;&#1607;', '&#1576;&#1585;&#1608;&#1586;&#1585;&#1587;&#1575;&#1606;&#1740; &#1575;&#1587;&#1705;&#1585;&#1740;&#1662;&#1578;', '1401/12/21', '1405/12/20', '100000', '&#1580;&#1607;&#1578; &#1575;&#1585;&#1587;&#1575;&#1604; &#1607;&#1583;&#1740;&#1607; &#1576;&#1607; &#1576;&#1585;&#1606;&#1575;&#1605;&#1607; &#1606;&#1608;&#1740;&#1587; &#1601;&#1575;&#1705;&#1578;&#1608;&#1585; &#1585;&#1575; &#1575;&#1586; &#1591;&#1585;&#1740;&#1602; admin &#1608;&#1740;&#1585;&#1575;&#1740;&#1588; &#1705;&#1606;&#1740;&#1583; &#1608; &#1605;&#1576;&#1604;&#1594;&#1740; &#1585;&#1575; (&#1607;&#1585;&#1670;&#1740; &#1705;&#1585;&#1605;&#1578;) &#1608;&#1575;&#1585;&#1583; &#1705;&#1606;&#1740;&#1583;. &#1575;&#1586; &#1589;&#1601;&#1581;&#1607; &#1575;&#1589;&#1604;&#1740; &#1605;&#1740; &#1578;&#1608;&#1575;&#1606;&#1740;&#1583; &#1662;&#1585;&#1583;&#1575;&#1582;&#1578; &#1705;&#1606;&#1740;&#1583;.', 'nopay', '', '', ''),
(1000, '&#1601;&#1575;&#1705;&#1578;&#1608;&#1585; &#1578;&#1587;&#1578; &#1588;&#1605;&#1575;&#1585;&#1607; &#1777;', '&#1586;&#1585;&#1740;&#1606; &#1662;&#1575;&#1604;', '&#1578;&#1587;&#1578;', '1401/12/20', '1402/01/13', '20000', '&#1578;&#1608;&#1590;&#1740;&#1581;&#1575;&#1578; &#1570;&#1586;&#1605;&#1575;&#1740;&#1588;&#1740;', 'nopay', '', '', '');
(110, '&#1605;&#1583;&#1740;&#1585; &#1587;&#1575;&#1740;&#1578;', '&#1576;&#1585;&#1606;&#1575;&#1605;&#1607; &#1606;&#1608;&#1740;&#1587; &#1605;&#1606;&#1578;&#1588;&#1585; &#1705;&#1606;&#1606;&#1583;&#1607;', '&#1576;&#1585;&#1608;&#1586;&#1585;&#1587;&#1575;&#1606;&#1740; &#1575;&#1587;&#1705;&#1585;&#1740;&#1662;&#1578;', '1401/12/21', '1405/12/20', '100000', '&#1580;&#1607;&#1578; &#1575;&#1585;&#1587;&#1575;&#1604; &#1607;&#1583;&#1740;&#1607; &#1576;&#1607; &#1576;&#1585;&#1606;&#1575;&#1605;&#1607; &#1606;&#1608;&#1740;&#1587; &#1601;&#1575;&#1705;&#1578;&#1608;&#1585; &#1585;&#1575; &#1575;&#1586; &#1591;&#1585;&#1740;&#1602; admin &#1608;&#1740;&#1585;&#1575;&#1740;&#1588; &#1705;&#1606;&#1740;&#1583; &#1608; &#1605;&#1576;&#1604;&#1594;&#1740; &#1585;&#1575; (&#1607;&#1585;&#1670;&#1740; &#1705;&#1585;&#1605;&#1578;) &#1608;&#1575;&#1585;&#1583; &#1705;&#1606;&#1740;&#1583;. &#1575;&#1586; &#1589;&#1601;&#1581;&#1607; &#1575;&#1589;&#1604;&#1740; &#1605;&#1740; &#1578;&#1608;&#1575;&#1606;&#1740;&#1583; &#1662;&#1585;&#1583;&#1575;&#1582;&#1578; &#1705;&#1606;&#1740;&#1583;.', 'nopay', '', 'a@d.co', ''),
(1000, '&#1601;&#1575;&#1705;&#1578;&#1608;&#1585; &#1578;&#1587;&#1578; &#1588;&#1605;&#1575;&#1585;&#1607; &#1777;', '&#1586;&#1585;&#1740;&#1606; &#1662;&#1575;&#1604;', '&#1578;&#1587;&#1578;', '1401/12/20', '1402/01/13', '20000', '&#1578;&#1608;&#1590;&#1740;&#1581;&#1575;&#1578; &#1570;&#1586;&#1605;&#1575;&#1740;&#1588;&#1740;', 'nopay', '', 'a@d.co', '');

-- --------------------------------------------------------

Expand All @@ -58,18 +58,18 @@ INSERT INTO `zng_factor` (`ID`, `from`, `to`, `for`, `createdate`, `paytime`, `p

CREATE TABLE `zng_system` (
`ID` int(11) NOT NULL,
`title` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`merchant` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`adminpass` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`webaddress` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
`title` varchar(1000) NOT NULL,
`merchant` varchar(1000) NOT NULL,
`adminpass` varchar(1000) NOT NULL,
`webaddress` varchar(1000) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `zng_system`
--

INSERT INTO `zng_system` (`ID`, `title`, `merchant`, `adminpass`, `webaddress`) VALUES
(1, '&#1662;&#1585;&#1583;&#1575;&#1582;&#1578; &#1588;&#1606;&#1575;&#1587;&#1607; &#1575;&#1740; &#1586;&#1585;&#1740;&#1606; &#1662;&#1575;&#1604; 23', '52d52aa3-542a-450d-9792-b3221b459dc5', '21232f297a57a5a743894a0e4a801fc3', 'http://localhost/zarinpalg/');
(1, '&#1662;&#1585;&#1583;&#1575;&#1582;&#1578; &#1588;&#1606;&#1575;&#1587;&#1607; &#1575;&#1740; &#1586;&#1585;&#1740;&#1606; &#1662;&#1575;&#1604;', '52d52aa3-542a-450d-9792-b3221b459dc5', '21232f297a57a5a743894a0e4a801fc3', 'http://localhost/zf/');

--
-- Indexes for dumped tables
Expand Down