private function get_response_from_message($message, $json_data = NULL)
 {
     //set the url of the server we need to request
     $url = CONFIG_PATH('class') . 'Server.php';
     //put message request into package
     $package = new Package($message, $json_data);
     $options = array('http' => array('method' => 'POST', 'content' => $package->json_encode(), 'header' => "Content-Type: application/json\r\n" . "Accept: application/json\r\n" . "Connection: close\r\n"));
     $context = stream_context_create($options);
     $result = file_get_contents($url, false, $context);
     //if we need to get respone from server, return respone after get it
     $response = json_decode($result, true);
     return $response;
 }
 private function get_response_from_message($message, $json_data = NULL)
 {
     //set the url of the server we need to request
     $url = CONFIG_PATH('class') . 'Server.php';
     //put request into data
     $data = array();
     $data['request'] = $message;
     //if there is the data that need to be push in server, push it in
     if (!is_null($json_data)) {
         $data['data'] = $json_data;
     }
     $options = array('http' => array('method' => 'POST', 'content' => json_encode($data), 'header' => "Content-Type: application/json\r\n" . "Accept: application/json\r\n" . "Connection: close\r\n"));
     $context = stream_context_create($options);
     $result = file_get_contents($url, false, $context);
     //if we need to get respone from server, return respone after get it
     $response = json_decode($result, true);
     return $response;
 }
Пример #3
0
<?php

include $_SERVER["DOCUMENT_ROOT"] . 'Tam-An-Food-Store-Manager/' . 'config.php';
require_once FUNCTION_PATH . "general_function.php";
deleteSession();
redirect_to(CONFIG_PATH('public_HTML') . "login/");
function JS_CONFIG_PATH($directory, $file)
{
    echo CONFIG_PATH($directory) . $file;
}
?>
">
	<link rel="stylesheet" type="text/css" href="<?php 
echo CONFIG_PATH('style') . "login/demo.css";
?>
"/>
    <link rel="stylesheet" type="text/css" href="<?php 
echo CONFIG_PATH('style') . "login/style.css";
?>
" />
    <link rel="stylesheet" type="text/css" href="<?php 
echo CONFIG_PATH('style') . "login/animate-custom.css";
?>
"/>

	<!-- javascript library -->
	<script type="text/javascript" src="<?php 
echo CONFIG_PATH('lib') . "jquery.min.js";
?>
" ></script>
	<script type="text/javascript" src="<?php 
echo CONFIG_PATH('lib') . "bootstrap/js/bootstrap.min.js";
?>
"></script>
	
	<!-- project js library -->
	<script type="text/javascript" src="<?php 
echo CONFIG_PATH('js') . "general.js";
?>
"></script>
</head>
Пример #6
0
	<!-- javascript library -->
	<script type="text/javascript" src="<?php 
echo CONFIG_PATH('lib') . "jquery.min.js";
?>
" ></script>
	<script type="text/javascript" src="<?php 
echo CONFIG_PATH('lib') . "bootstrap/js/bootstrap.min.js";
?>
"></script>
	<script type="text/javascript" src="<?php 
echo CONFIG_PATH('lib') . "select2/select2.min.js";
?>
"></script>
	<script type="text/javascript" src="<?php 
echo CONFIG_PATH('lib') . "sorttable_custom.js";
?>
"></script>
	<!-- project javascript library -->
	<script type="text/javascript" src="<?php 
echo CONFIG_PATH('js') . "general.js";
?>
"></script>
	<script type="text/javascript" src="<?php 
echo CONFIG_PATH('js') . "task_manager.js";
?>
"></script>
	<script type="text/javascript" src="<?php 
echo CONFIG_PATH('js') . "html_helper.js";
?>
"></script>
</head>
<?php

session_start();
require_once $_SERVER['DOCUMENT_ROOT'] . 'Tam-An-Food-Store-Manager/' . 'config.php';
?>

<script type="text/javascript" src="<?php 
echo CONFIG_PATH('js') . "receipt_function.js";
?>
"></script>


<div class="receipt-view">

	<form id="receipt-form" method="post" role="form">

		<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar2" >
			<span class="sr-only">Toggle navigation</span>
			<span class="icon-bar black-icon-bar"></span>
			<span class="icon-bar black-icon-bar"></span>
			<span class="icon-bar black-icon-bar"></span>   
		</button>

		<div class="form-group collapse navbar-collapse navbar2" style ="padding:0;">

			<input type="button" value="In" onclick="print_button()" id="print" class="btn btn-primary pull-right bigBtn" tabindex="-1">
			<input type="button" value="Xem trước" onclick="preview_button()" id="preview" class="btn btn-primary pull-right bigBtn" data-toggle="modal" data-target="#preview_modal" tabindex="-1">
			<input type="button" value="Xóa" id="cancel" class="btn btn-primary pull-right bigBtn" tabindex="-1">

		</div>
<?php

session_start();
require_once $_SERVER["DOCUMENT_ROOT"] . 'Tam-An-Food-Store-Manager/' . 'config.php';
?>

<?php 
// list of option
$task_option = array(array("blank", CONFIG_PATH("view") . "blank.php", "blank"), array("receipt", CONFIG_PATH("view") . "receipt_task_view.php", "In hóa đơn"), array("alter-product", CONFIG_PATH("view") . "alter_product_task_view.php", "Quản lý sản phẩm"));
if (isset($_GET['q']) && !empty($_GET['q'])) {
    $get = json_decode($_GET['q'], true);
    $action = $get['action'];
    switch ($action) {
        case 'get_task_options':
            $user_type = $_SESSION['user_type'];
            if (strcmp($user_type, "admin") == 0) {
                echo json_encode($task_option);
            } else {
                echo json_encode(array($task_option[0], $task_option[1]));
            }
            break;
        case 'get_taskid_from_task':
            $task = $get['task'];
            if (isset($_SESSION['task'])) {
                $task_arr = $_SESSION['task'];
                if (is_int(array_search($task, $task_arr))) {
                    echo array_search($task, $task_arr);
                } else {
                    echo -1;
                }
            } else {
<?php

require_once $_SERVER["DOCUMENT_ROOT"] . 'Tam-An-Food-Store-Manager/' . 'config.php';
?>
<script type="text/javascript" src="<?php 
echo CONFIG_PATH('js') . "alter_product_function.js";
?>
"></script>
<!-- use 1 table to display Add more Product and Search-->
<div class="table-responsive"> 
	<table class="table">
		<tr>
			<td class= "cell-title">Thêm mới:</td>
			<td> 
				<button type="button" id= "add_one_more_product" class="btn btn-primary" 
						data-toggle="modal" data-target="#add_one_product_modal" tabindex="-1">
					<span class="glyphicon glyphicon-plus"></span>
					1
				</button> 
				<button type="button" class="btn btn-primary hide" tabindex="-1">Hàng loạt từ file</button> 
			</td>
		</tr>
		<tr>
			<td class= "cell-title">Tra cứu:</td>
			<td> <input type="text" id ="product-search" placeholder="Tìm Kiếm" onkeydown =""style="width:100%;font-size: 15px;padding:5px;"/> </td> 
			<td> 
				<button style="font-size = 10px"class="btn btn-default" tabindex="-1" onclick="alter_product_search_product()">
				Tìm <span class="glyphicon glyphicon-search" ></span></button> 
			</td>
		</tr>
	</table>
Пример #10
0
                
            </button>

        </div>
        
        <div class = "collapse navbar-collapse">
           
           <div class="inner-collapse">
                <div id ="header"><p> Thực Phẩm Sạch <span id="VN"> VIỆT NAM </span> </p></div>
                
                <ul id="sign-in" class="nav navbar-nav">
 
                    <li>
                        <div >
                            <?php 
$logouturl = CONFIG_PATH('public_HTML') . 'log-out/';
if (isset($USER_NAME)) {
    echo $USER_NAME . "<br \\>" . '<a tabindex="-1" style = "float:right" href="' . $logouturl . '">Log Out</a>';
}
?>
                            
                        </div>
                    </li>                 
                </ul>
                
            </div>
        </div>
    </div>
   

   
Пример #11
0
if (isset($_SESSION['is_login'])) {
    redirect_to(CONFIG_PATH('public_HTML'));
}
require_once VIEW_PATH . "login_head.php";
require_once VIEW_PATH . "header.php";
?>
  <html lang="en" class="no-js"> 
    
    <script type="text/javascript" src="<?php 
echo CONFIG_PATH('js') . "login_function.js";
?>
"></script>
    <style>
      .login-cover:before{
        background-image: url("<?php 
echo CONFIG_PATH('image') . 'background.jpg';
?>
");
      }
    }
    </style>
    <body >
        <div class="container login-cover" >
            <section>  
              <div id="container_demo" >
                  <div id="wrapper">
                      <div id="login" style="background-color:white; opacity:0.9" class="animate form">

                          <form  id ="login-form" autocomplete="on" method = "POST" class="form-group"> 
                              <h1>Xin Chào</h1> 
                              <p> 
Пример #12
0
    $ID = $_SESSION['user_id'];
} else {
    redirect_to(CONFIG_PATH('public_HTML') . "login/");
}
?>

<!doctype html>
<html>

<?php 
require_once VIEW_PATH . "head.php";
?>
<style type="text/css">
	.main-screen:before{	
	  background-image: url("<?php 
echo CONFIG_PATH('image') . 'test3.jpg';
?>
");
	}
</style>

<body >		
	<div class="no-print main-screen"> 
		<?php 
require_once VIEW_PATH . "header.php";
?>

		<div id ="loadpanel1" class="container">
			
			<div class="inner-content">
				<select id="task1" tabindex="-1" class="form-control " onchange="switch_task(1)">
Пример #13
0
                              <p> 
                                  <label for="emailsignup" class="youmail" data-icon="e" > Your email</label>
                                  <input id="emailsignup" name="email" required="required" type="email" placeholder="my email"/> 
                              </p>
                              <p> 
                                  <label for="passwordsignup" class="youpasswd" data-icon="p">Your password </label>
                                  <input id="passwordsignup" name="password" required="required" type="password" placeholder="my password"/>
                              </p>
                              <p> 
                                  <label for="passwordsignup_confirm" class="youpasswd" data-icon="p">Please confirm your password </label>
                                  <input id="passwordsignup_confirm" name="password_confirm" required="required" type="password" placeholder="confirm password"/>
                              </p>
                              <p class="signin button"> 
                                  <input type="submit" value="Sign up" name ="request"/> 
                              </p>
                              <p class="change_link">  
                                  Already a member ?
                                  <a href="<?php 
echo CONFIG_PATH('public_HTML') . "login";
?>
" class="to_register"> Go and log in </a>
                              </p>
                          </form>
                      </div>
                  </div>
              </div>  
           
            </section>
        </div>
    </body>
</html>
Пример #14
0
(function() {
   	var dialog = document.getElementById('window2');
	document.getElementById('delete').onclick = function() {
		dialog.show();
	};
	document.getElementById('exit2').onclick = function() {
		dialog.close();
	};
})();

</script>

		
		
	</div>
	<div id="f**k">
	
		<form method="post" action=<?php 
echo CONFIG_PATH('view') . "switch_task.php";
?>
>
			<select name="task1" style="margin:10px;">
				<option value="1">In hóa đơn</option>
				<option value="2">Quản lý nhập</option>
				<option value="3">Quản lý dư</option>
				</select>			
		</form>
	</div>
	
</body>
</html>
<?php

//if receive request from signup, call server to insert user info to database
require_once $_SERVER["DOCUMENT_ROOT"] . 'Tam-An-Food-Store-Manager/' . 'config.php';
if (isset($_POST['request'])) {
    require_once CLASS_PATH . "Management.php";
    require_once FUNCTION_PATH . "functions.php";
    $data = array();
    $data['username'] = $_POST['username'];
    $data['name'] = $_POST['name'];
    $data['email'] = $_POST['email'];
    $data['password'] = $_POST['password'];
    $data['password_confirm'] = $_POST['password_confirm'];
    $manage = new Management();
    print_r($manage->sign_up($data));
    redirect_to(CONFIG_PATH("public_HTML") . "login/");
}