Вы находитесь на странице: 1из 41

CHAPTER-1

INTRODUCTION

The COMMODITY TRADING SYSTEM is a real-time inventory database capable


of connecting multiple stores. This can be used to track the inventory of a single
store, or to manage the distribution of stock between several branches of a larger
franchise. However, the system merely records sales and restocking data and
provides notification of low stock at any location through individual at a specified
interval. The goal is to reduce the strain of tracking rather than to handle all store
maintenance. Further features may include the ability to generate reports of sales,
but again the interpretation is left to the management. In addition, since theft does
occasionally occur, the system provides solutions for confirming the store
inventory and for correcting stock quantities. India has the largest cattle and
buffalo population in the world. Cows and buffaloes are the main miltch animals,
contributing 96% of the total milk production of the country. However the average
yield of Indian cows is among the lowest, though the yield of Indian buffaloes is
modest. The average milk yield of buffaloes and cows put together is much less
than the global average. There are significant regional variations in the structure of
dairying in the country. There are different issues faced by dairy industry in India,
some are area specific while some are common.The present study is intended to
understand these issues and Challenges faced by dairy stakeholders. The basic
intent of the study is to have an overview of Indian Dairy Industry. To understand
the problems faced by the dairy sector units, the prose and corns of various issues.
The study is carried out to understand the magnitude of the research work carried
out in the field and understand the unresolved issued if any that can pave the path
for further research in the field

1
CHAPTER-2

PROBLEM STATEMENT

The high growth of the company, it also brings high commodity trading as the
demand for the products and customers start increasing. In this case it is very
difficult to keep track of all the products that's been supplied to the customer and
brought back due to complaints or those products purchased and kept in godown. It
is very difficult to manage all the process manually and there are more chances of
theft or there are chances of missing values which in turn gives huge impact
affecting the organization. Also, the problem arises when there is a input request
from a customer, it could be via call, text or Email. If that request goes un noticed
there arises a clear mess.

To overcome this problem, this application is been introduced. In this


project, we propose a clear data's for both Customer and the Admin to register all
the details without any stress or stain and just by entering the data's and going
through the requests.

2
CHAPTER-3

LITERATURE SURVEY

3.1 A Framework for the Development of Computerized Management and


Control Systems for Use in Dairy Farming
D. Pietersma, R. Lacroix, K.M. Wade

Department of Animal Science, McGill University, Macdonald Campus, 21,111


Lakeshore Road, Ste-Anne de Bellevue, QC Canada H9X 3V9

Computerized information systems can potentially help the dairy producer to deal
with the increased complexity of decision making and availability of information
in dairy farming. These systems, however, should be fully integrated to ensure a
coordinated execution of dairy farming activities. A framework was developed,
therefore, to support the creation of computerized management and control systems
in dairy farming. Within this framework, a management and control system was
defined as a network consisting of the management and control activities and the
information flows that are involved in dairy farming. The management and control
activities consist of a cycle of decision making, implementation, and assessment.
These activities were classified according to level (strategic, tactical, operational,
or regulatory) and sphere (breeding, health, nutrition, environment, milk
production, fixed assets, labor, or finance). These activities can be performed by
human beings or automated systems that are located on or off the farm. A large
amount of information exchange exists among these management and control
activities, between the overall management and control system, and between the
physical farm environment and external agents. The interdependence among
decisions at the various levels and spheres necessitates computerized management
and control systems that are integrated and that support the exchange of

3
information. The developed framework should facilitate the creation of such
systems and could also act as a reference base for the analysis and improvement of
existing dairy farm information systems.

3.2 Development of Integrated Management Information System


for Dairy Producers
A.C. Bywater
Department of Animal Science, University of California, Davis 95616

This paper considers the extent to which concepts of an integrated management


information system have been or might be developed for application in dairy
production. Major features of such a system are described as capabilities to process
records for evaluating current and historical states of the business, to project
anticipated events and performance in the immediate future as a means of
monitoring and controlling current activities, and to provide both long- and short-
run projections of physical and financial performance as an aid to planning and
decision making. These concepts are discussed in relation to types of decision aids
and systems analyses that have been developed for and of dairy production. Two
issues in particular are highlighted. The first concerns integration of predictive
models with record processing capabilities so that projections for both planning
and control are based on the most up-to-date description of the structure, capacity,
operating constraints, and policies of the individual business. The second concerns
definition of predictive models with respect to simplicity versus accuracy in
representation of the complexity and dynamic, holistic properties of biological
production systems. Alternative approaches to these problems are discussed. While
many components of an effective management information system have been
developed, their combination into a single integrated system has not occurred. The

4
structure and anticipated operation of a proposed dairy information system are
outlined.

3.3 New features, forgotten costs and counterfactual gains of the international
trading system

Luca Salvatici Silvia Nenci


European Review of Agricultural Economics, Volume 44, Issue 4, 1 September
2017, Pages 592–633
We critically survey the literature dealing with some of the significant changes that
have recently occurred in international trade flows and policies. The aim is to offer
a ‘road map’ through large swathes of literature and inform the profession of recent
developments that can assist us as we seek to analyse agricultural markets and
policies. In the first part, we analyse the increasing importance of global value
chains and highlight the systemic structure of trade relations. In the second part, we
run through the most recent literature that assesses the impacts of trade
liberalisation. On the one hand, increasing attention has been paid to the trade
adjustment costs; on the other hand, the new (new) trade theory has provided
valuable insights in order to better estimate gains from trade.

5
CHAPTER-4

SYSTEM ANALYSIS

4.1 EXISTING SYSTEM

When we Analysis the Manage about this firm then we face that they working with manual. And
we all know that the manual system has many disadvantages. Some are mentioned below…

 The manual system requires more time for processing.


 It requires more critical work.
 The manual system is more error prone.
 Difficult to maintain.
 Manual system is costly.
 Immediate response to the queries is difficult and time consuming.
 More men power needed.
 Manual system show of the particular place.

4.2 DISADVANTAGE OF EXISTING SYSTEM

One of the major risks covered by this application is theft breaks synchronization between the
inventory and the database. The information could be generated by the data stored in this
application. The confidence level of trusting data generated depends on the accuracy of the
restocking procedure. Therefore, we are facing a risk of reckless stock manager who could
detriment the accuracy of the data. As of the reliability of the SSL encryption, a resolution for
this could be by developing SSL and digital certificate policy and configuration guidelines. In
addition, giving a choice to the user to set the minimum level of SSL used by not violating the
policy should convince them the trustworthiness of the application. Another risk is the
competition from other Point of Service software. There are several large competitors in this
field including a solution from Microsoft; however, all of these tend to be expensive.
COMMODITY TRADING SYSTEM will be a low cost solution mainly targeted at smaller
businesses while including the possibility of later expansion.

6
4.3 PROPOSED SYSTEM

The COMMODITY TRADING SYSTEM application is emulating a cash registers interface to


work with our software by simulating barcode inputs. A more realistic design of cash register
interface can be done to suit the integration, as the interface does not interfere with the data
collected. We expect that the cash registers clients are able to update their data to the current
point of sale in case of loss of connection to the server. The particular restocking procedure
adopted by each store does interfere with the feasibility and accuracy of the application as it
does not remind the stock manager to update the data each time they had done any restocking.
We also trust that that the Secure Socket Layer (SSL) is reliable in creating a secure connection
between a client and a server.

4.4 ADVANTAGE OF PROPOSED SYSTEM

 The advantages of the proposed systems include,


 The new system required less time for completion of any work.
 New system is decreasing the chances of error.
 New system should work smoothly and very fast.
 New system saving time and manpower.
 The system is user friendly and anyone having computer knowledge can
handle it easily. Suitability for computerized data entry. Maintaining Dairy
information, Staff information and customer information.

4.5 METHODOLOGY AND DEVELOPMENT

The study is based on available literature extracted from different databases. This is a qualitative
study intended to understand the issues related to Indian dairy industry, the structure, different
players in the sector; the role played by different government institutions, the programmes run by
the government and the success or failure of these programmes in
dairy development.

7
Commodity Options:
Trading in commodity options contracts has been banned since 1952. The market for commodity
derivatives cannot be called complete without the presence of this important derivative. Both
futures and options are necessary for the healthy growth of the market. While futures contracts
help a participant (say a farmer) to hedge against downside price movements, it does not allow
him to reap the benefits of an increase in prices. No doubt there is an immediate need to bring
about the necessary legal and regulatory changes to introduce commodity options trading in the
country. The matter is said to be under the active consideration of the Government and the
options trading may be introduced in the near future.

The Warehousing and Standardization:


For commodity derivatives market to work efficiently, it is necessary to have a sophisticated,
cost-effective, reliable and convenient warehousing system in the country. The Habibullah
(2003) task force admitted, “A sophisticated warehousing industry has yet to come about”.
Further, independent labs or quality testing centers should be set up in each region to certify the
quality, grade and quantity of commodities so that they are appropriately standardized and there
are no shocks waiting for the ultimate buyer who takes the physical delivery. Warehouses also
need to be conveniently located.
Central Warehousing Corporation of India (CWC: www.fieo.com) is operating 500 Warehouses
across the country with a storage capacity of 10.4 million tons. This is obviously not adequate for
a vast country. To resolve the problem, a Gramin Bhandaran Yojana (Rural Warehousing Plan)
has been introduced to construct new and expand the existing rural godowns. Large scale
privatization of state warehouses is also being examined.

Cash versus Physical Settlement:


It is probably due to the inefficiencies in the present warehousing system that only about 1% to
5% of the total commodity derivatives trades in the country are settled in physical delivery.
Therefore the warehousing problem obviously has to be handled on a war footing, as a good
delivery system is the backbone of any commodity trade. A particularly difficult problem in cash
settlement of commodity derivative contracts is that at present, under the Forward Contracts
8
(Regulation) Act 1952, cash settlement of outstanding contracts at maturity is not allowed. In
other words, all outstanding contracts at maturity should be settled in physical delivery. To avoid
this, participants square off their positions before maturity. So, in practice, most contracts are
settled in cash but before maturity. There is a need to modify the law to bring it closer to the
widespread practice and save the participants from unnecessary hassles.

The Regulator:
As the market activity pick-up and the volumes rise, the market will definitely need a strong and
independent regular; similar to the Securities and Exchange Board of India (SEBI) that regulates
the securities markets. Unlike SEBI which is an independent body, the Forwards Markets
Commission (FMC) is under the Department of Consumer Affairs (Ministry of Consumer
Affairs, Food and Public Distribution) and depends on it for funds. It is imperative that the
Government should grant more powers to the FMC to ensure an orderly development of the
commodity markets. The SEBI and FMC also need to work closely with each other due to the
inter-relationship between the two markets.

Lack of Economy of Scale:


There are too many (3 national level and 21 regional) commodity exchanges. Though over 80
commodities are allowed for derivatives trading, in practice derivatives are popular for only a
few commodities. Again, most of the trade takes place only on a few exchanges. All this splits
volumes and makes some exchanges unviable. This problem can possibly be addressed by
consolidating some exchanges. Also, the question of convergence of securities and commodities
derivatives markets has been debated for a long time now. The
Government of India has announced its intention to integrate the two markets. It is felt that
convergence of these derivative markets would bring in economies of scale and scope without
having to duplicate the efforts, thereby giving a boost to the growth of commodity derivatives
market. It would also help in resolving some of the issues concerning regulation of the derivative
markets. However, this would necessitate complete coordination among various regulating
authorities such as Reserve Bank of India, Forward Markets commission, the Securities and
Exchange Board of India, and the Department of Company affairs etc.

9
Tax and Legal bottlenecks:
There are at present restrictions on the movement of certain goods from one state to another.
These need to be removed so that a truly national market could develop for commodities and
derivatives. Also, regulatory changes are required to bring about uniformity in octroi and sales
taxes etc. VAT has been introduced in the country in 2005, but has not yet been uniformly
implemented by all states.
CHAPTER-5

SYSTEM SPECIFICATION

5.1 SOFTWARE SPECIFICATION

5.1.1 Web Server

Apache will be used as web server:

 The user inputs data via the web server using HTML forms
 The web server executes the PHP as a module and PHP script retrieves the
post data if available.
 The web server receives information back from the PHP script.
 The web server displays a HTML page as result to the end-user.
5.1.2 PHP Application

The actual program that will perform the operations is written in PHP. All
data will be stored in a database.

5.2 External Interface Requirements

Operator/user interface characteristics from the human factors point of view

10
This will interface with most browsers, especially Internet Explorer, Firefox and
Safari. As long as the user has knowledge to operate a web browser, they will be
able to operate our website efficiently.

Characteristics required of the interface between the software product and each of
the hardware components

The hardware will be accessed indirectly, both from the client side (via a web
browser) and server side via the various program APIs (MySQL, Apache, PHP)

Interfaces with other software components or products, including other systems,


utility software, databases, and operating systems

We will be accessing Drupal via the creation of our own modules.

The software will be using Drupal to communicate with My SQL via My PHP
Admin, Apache and PHP.

My SQL, PHP, and Apache will all be accessing the hardware through their own
APIs.

5.3 MySQL Database

It’s an open source SQL database to store all data which communicates with
the application on the server.

5.4 COMMON LANGUAGE RUNTIME

The common language runtime manages memory, thread execution, code


execution, code safety verification, compilation, and other system services. These
features are intrinsic to the managed code that runs on the common language
runtime. With regards to security, managed components are awarded varying
degrees of trust, depending on a number of factors that include their origin (such as
11
the Internet, enterprise network, or local computer). This means that a managed
component might or might not be able to perform file-access operations, registry-
access operations, or other sensitive functions; even if it is being used in the same
active application. The runtime enforces code access security. For example, users
can trust that an executable embedded in a Web page can play an animation on
screen or sing a song, but cannot access their personal data, file system, or
network. The security features of the runtime thus enable legitimate Internet-
deployed software to be exceptionally feature rich.

The runtime also enforces code robustness by implementing a strict type-


and-code-verification infrastructure called the common type system (CTS). The
CTS ensures that all managed code is self-describing. The various Microsoft and
third-party language compilers generate managed code that conforms to the CTS.
This means that managed code can consume other managed types and instances,
while strictly enforcing type fidelity and type safety.

5.4.1 FEATURES OF THE COMMON LANGUAGE RUNTIME

Common Language Runtime is a heart of the .net framework. It actually


manages the code during Execution. The Code that runs under the CLR is called
“Managed Code”. The code that is executed under .net runtime gets benefits like
cross language inheritance, cross language exception handling, enhanced
Security, Versioning and development support, a simplified model for
component interaction, debugging and Profiling services.

12
5.5 FEATURES OF SQL SERVER

Microsoft SQL Server 2008

The following is a list of the new features provided in SQL Server 2008:

 Database mirroring
 Database snapshots
 CLR integration
 Service Broker
 Database Mail
 User-defined functions
 Indexed views
 Distributed partitioned views
 INSTEAD OF and AFTER triggers
 New data types
 Cascading RI constraints
 Multiple SQL Server instances
 XML support
 Log shipping

Database mirroring
Database mirroring is a new high-availability feature in SQL Server 2008.
It's similar to server clustering in that failover is achieved by the use of a stand-by
server; the difference is that the failover is at the database level rather than the
server level. The primary database continuously sends transaction logs to the
backup database on a separate SQL Server instance. A third SQL Server instance is

13
then used as a witness database to monitor the interaction between the primary and
the mirror databases.

Database snapshots
A database snapshot is essentially an instant read-only copy of a database,
and it is a great candidate for any type of reporting solution for your company. In
addition to being a great reporting tool, you can revert control from your primary
database to your snapshot database in the event of an error. The only data loss
would be from the point of creation of the database snapshot to the event of failure.

Service Broker
This feature gives you the ability to create asynchronous, message-based
applications in the database entirely through TSQL. The database engine
guarantees message delivery, message order consistency, and handles message
grouping. In addition, Service Broker gives you the ability to send messages
between different SQL Server instances. Server Broker is also used in several other
features in SQL Server 2008. For example, you can define Event Nonfictions in the
database to send a message to a Queue in the database when someone attempts to
alter a table structure, of if there is a string of login failures.

User-Defined Functions

SQL Server has always provided the ability to store and execute SQL code
routines via stored procedures. In addition, SQL Server has always supplied a
number of built-in functions. Functions can be used almost anywhere an
expression can be specified in a query. This was one of the shortcomings of stored
procedures—they couldn't be used in line in queries in select lists, where clauses,
and so on. Perhaps you want to write a routine to calculate the last business day of

14
the month. With a stored procedure, you have to exec the procedure, passing in the
current month as a parameter and returning the value into an output variable, and
then use the variable in your queries. If only you could write your own function
that you could use directly in the query just like a system function. In SQL Server
2008, you can.

SQL Server 2008 introduces the long-awaited support for user-defined


functions. User-defined functions can take zero or more input parameters and
return a single value—either a scalar value like the system-defined functions, or a
table result. Table-valued functions can be used anywhere table or view
expressions can be used in queries, and they can perform more complex logic than
is allowed in a view.

Indexed Views

Views are often used to simplify complex queries, and they can contain joins
and aggregate functions. However, in the past, queries against views were resolved
to queries against the underlying base tables, and any aggregates were recalculated
each time you ran a query against the view. In SQL Server 2008 Enterprise or
Developer Edition, you can define indexes on views to improve query performance
against the view. When creating an index on a view, the result set of the view is
stored and indexed in the database. Existing applications can take advantage of the
performance improvements without needing to be modified.

Indexed views can improve performance for the following types of queries:

 Joins and aggregations that process many rows


 Join and aggregation operations that are performed frequently within many
queries
15
 Decision support queries that rely on summarized, aggregated data that is
infrequently updated

Distributed Partitioned Views

SQL Server 7.0 provided the ability to create partitioned views using the
UNION ALL statement in a view definition. It was limited, however, in that all the
tables had to reside within the same SQL Server where the view was defined. SQL
Server 2008 expands the ability to create partitioned views by allowing you to
horizontally partition tables across multiple SQL Servers. The feature helps you
scale out one database server to multiple database servers, while making the data
appear as if it comes from a single table on a single SQL Server. In addition,
partitioned views are now able to be updated.

INSTEAD OF and AFTER Triggers

In versions of SQL Server prior to 7.0, a table could not have more than one
trigger defined for INSERT, UPDATE, and DELETE. These triggers only fired
after the data modification took place. SQL Server 7.0 introduced the ability to
define multiple AFTER triggers for the same operation on a table. SQL Server
2008 extends this capability by providing the ability to define which AFTER
trigger fires first and which fires last.

SQL Server 2008 also introduces the ability to define INSTEAD OF


triggers. INSTEAD OF triggers can be specified on both tables and views.
(AFTER triggers can still only be specified on tables.) If an INSTEAD OF trigger
is defined on a table or view, the trigger will be executed in place of the data

16
modification action for which it is defined. The data modification is not executed
unless the SQL code to perform it is included in the trigger definition.

New Data types

SQL Server 2008 introduces three new data types. Two of these can be used as
datatypes for local variables, stored procedure parameters and return values, user-
defined function parameters and return values, or table columns:

 bigint—An 8-byte integer that can store values from –263 (–


9223372036854775808) through 263-1 (9223372036854775807).
 sql_variant—A variable-sized column that can store values of various SQL
Server-supported data types, with the exception of text, ntext, timestamp,
and sql_variant.

Cascading RI Constraints

In previous versions of SQL Server, referential integrity (RI) constraints


were restrictive only. If an insert, update, or delete operation violated referential
integrity, it was aborted with an error message. SQL Server 2008 provides the
ability to specify the action to take when a column referenced by a foreign key
constraint is updated or deleted. You can still abort the update or delete if related
foreign key records exist by specifying the NO ACTION option, or you can
specify the new CASCADE option, which will cascade the update or delete
operation to the related foreign key records.

Multiple SQL Server Instances

17
Previous versions of SQL Server supported the running of only a single
instance of SQL Server at a time on a computer. Running multiple instances or
multiple versions of SQL Server required switching back and forth between the
different instances, requiring changes in the Windows registry. (The SQL Server
Switch provided with 7.0 to switch between 7.0 and 6.5 performed the registry
changes for you.)

SQL Server 2005 provides support for running multiple instances of SQL
Server on the same system. This allows you to simultaneously run one instance of
SQL Server 6.5 or 7.0 along with one or more instances of SQL Server 2008. Each
SQL Server instance runs independently of the others and has its own set of system
and user databases, security configuration, and so on. Applications can connect to
the different instances in the same way they connect to different SQL Servers on
different machines.

CHAPTER-6

SYSTEM IMPLEMENTATION

6.1 LIST OF MODULES

Module description gives the detailed information about the module and its
supported components which is accessible in different manners. It also gives the
clear cut working study of the whole project. The project comprises of few
modules where the process is implemented step by step. The modules used are,

 ADMIN :-
• 1.Login
• 2.Manage product list
• 3.Manage Staff
18
• 4.Manage Seller

 USER :-
• 1.Registration
• 2.Login
• 3. Chat
• 4. Add customer details

19
CHAPTER-7

CONCLUSION

The Dairy organization information system has been developed for aim of Dairy
enterprise people or to manage their daily basis or any business activities that is
taking place in their dairy routine, the system comprises of the programming
languages PHP and SQL server in process of store data in tables which has been
created on SQL server. In term of the pervious old system do use papers on writing
information in those paper, but per now we had get the new technology that has
come to assist us and make thing easily for Dairy organization to make their record
on database procedure as saving data on it and therefore, the should use for
memory use in future as for report in monthly or as daily report to make
think easy.

CHAPTER - 8

FUTURE ENHANCEMENT

The project has covered almost all the requirements. Further requirements and
improvements can be done by integrating the system into an Android application
which gives alert in the mobile for each and every purchase made by the customer
and to the customer. Also, adding more features include:

• The buyer can make payments via the application.


• The seller can improve the application by adding more products.
• The security system will be improvised.

20
APPENDICES

APPENDIX I

21
22
APPENDIX II

PSEUDO CODE

<div class="span3" id="">


<div class="row-fluid">
<!-- block -->

<div id="block_bg" class="block">


<div class="navbar navbar-inner block-header">
<div id="" class="muted pull-left"><h4><i class="icon-plus-sign"></i>
Remaining Liters & Product</h4></div>

23
</div>
<?php
include('admin/dbcon.php');

$username = $_SESSION['id'];

$query = "SELECT * FROM `orders` WHERE cust_id = '".$username."' ";


$result = mysql_query($query)or die(mysql_error());

$num_row = mysql_num_rows($result);
if( $num_row!= 0 ) {
echo "<table style='border: 2px solid #000; width:100%;text-align: center;' >";
echo "<tr style='border: 2px solid #000;'
><th>Product</th><th>Liters</th></tr>";
while($row = mysql_fetch_array($result)){
echo "<tr style='border: 2px solid #000;'
><td>".$row['product']."</td><td>".$row['old_lit']."</td></tr>";
}
echo "</table>";
}
?>

</div>
<div id="block_bg" class="block">
<div class="navbar navbar-inner block-header">
<div id="" class="muted pull-left"><h4><i class="icon-plus-sign"></i>
Request Liters</h4></div>

24
</div>
<?php
$id = $session_id;
?>
<form id="add_liter_" class="form-addLiter" method="post">

<input type="text" class="input-block-level" id="addliter" name="Liter"


placeholder="addliter" required/>
<select class="input-block-level" id="product" name="product" required>
<option value="Milk">Milk</option>
<option value="Ghee">Ghee</option>
<option value="Butter">Butter</option>
<option value="Curd">Curd</option>
<option value="Oil">Oil</option>
</select>

<button id="signin" name="add" class="btn btn-info" type="submit"><i


class="icon-save"></i> Send</button>
<!-- <input id="signin" name="add" class="btn btn-info" type="submit"/> -->
</form>

</div>
<div id="block_bg" class="block">
<div class="navbar navbar-inner block-header">

25
<div id="" class="muted pull-left"><h4><i class="icon-plus-sign"></i>
Add Customers</h4></div>
</div>
<?php
$id = $session_id;
?>
<form id="add_custltrs_" class="form-addCust" method="post">

<input type="text" class="input-block-level" id="addcust" name="addcust"


placeholder="Customers Name" required/>
<input type="text" class="input-block-level" id="addliter" name="Liter"
placeholder="Add liter" required/>
<select class="input-block-level" id="product" name="product" required>
<option value="Milk">Milk</option>
<option value="Ghee">Ghee</option>
<option value="Butter">Butter</option>
<option value="Curd">Curd</option>
<option value="Oil">Oil</option>
</select>

<button id="addltrs" name="addltrs" class="btn btn-info" type="submit"><i


class="icon-save"></i> Save</button>
<!-- <input id="signin" name="add" class="btn btn-info" type="submit"/> -->
</form>

</div>

26
</div>
</div>

<script>
jQuery(document).ready(function($){
jQuery("#add_liter_").submit(function(e){
e.preventDefault();
var formData = jQuery(this).serialize();
$.jGrowl("Loading File Please Wait......", { sticky: false });
$.ajax({
type: "POST",
url: "add_liters_data.php",
data: formData,
success: function(html){
$.jGrowl("liters Successfully Added To Diary", { header: 'Event
Added' });

window.location = 'add-liters.php?id=222';
}
});return true;
});
jQuery("#add_custltrs_").submit(function(e){
e.preventDefault();
var formData = jQuery(this).serialize();
$.jGrowl("Request Failed.....", { sticky: false });
$.ajax({

27
type: "POST",
url: "add_cust_liters_data.php",
data: formData,
success: function(html){

if(html == 'true'){
window.location = 'add-liters.php?id=222';
}else{
$.jGrowl("Request more liters", { header: 'Less
Liters' });
}

}
});return true;
});
});
</script>

<?php
include('session.php');
//Include database connection details
require("opener_db.php");
$errmsg_arr = array();
//Validation error flag
$errflag = false;
$id = $session_id;
$name = $_POST['name'];
if ($_FILES['uploaded_file']['size'] >= 1048576 * 5) {

28
$errmsg_arr[] = 'file selected exceeds 5MB size limit';
$errflag = true;
}

$rd2 = mt_rand(1000, 9999) . "_File";

//Check that we have a file


if ((!empty($_FILES["uploaded_file"])) && ($_FILES['uploaded_file']['error'] == 0)) {
//Check if the file is JPEG image and it's size is less than 350Kb
$filename = basename($_FILES['uploaded_file']['name']);

$ext = substr($filename, strrpos($filename, '.') + 1);

if (($ext != "exe") && ($_FILES["uploaded_file"]["type"] != "application/x-msdownload")) {


//Determine the path to which we want to save this file
//$newname = dirname(__FILE__).'/upload/'.$filename;
$newname = "admin/uploads/" . $rd2 . "_" . $filename;
$name_notification = 'Add uploads Materials file name'." ".'<b>'.$name.'</b>';
//Check if the file with the same name is already exists on the server
if (!file_exists($newname)) {
//Attempt to move the uploaded file to it's new place
if ((move_uploaded_file($_FILES['uploaded_file']['tmp_name'], $newname))) {
//successful upload
// echo "It's done! The file has been saved as: ".$newname;

if (isset($_POST['add'])){

29
$user_id = $_POST['id'];
// $name = mysql_real_escape_string($_POST['name']);
$number = $_POST['number'];
$mobile = $_POST['mobile'];
$email = mysql_real_escape_string($_POST['email']);
$work = $_POST['work'];
$address = mysql_real_escape_string($_POST['address']);
$school = $_POST['school'];
// $pix = $_POST['pix'];
$group = $_POST['group'];
$note = mysql_real_escape_string($_POST['note']);
}
echo $time = date("Y-m_d : h:i");
$qry2 = "INSERT INTO `contact` (`id`, `user_id`, `name`, `number`,
`mobile`, `email`, `work`, `address`, `school`, `pix`, `group`, `note`,`time_add`) VALUES
(NULL, $user_id, '$name', '$number', '$mobile', '$email', '$work', '$address', '$school',
'$newname', '$group','$note','$time')";
$result2 = $connector->query($qry2);
if ($result2) {
echo "inserted";
$errmsg_arr[] = 'record was saved in the database and the file was uploaded';
$errflag = true;
if ($errflag) {
$_SESSION['ERRMSG_ARR'] = $errmsg_arr;
session_write_close();
?>

<?php

30
exit();
}
} else {
$errmsg_arr[] = 'record was not saved in the database but file was uploaded';
$errflag = true;
if ($errflag) {
$_SESSION['ERRMSG_ARR'] = $errmsg_arr;
session_write_close();
echo "uploaded";
?>

<script>
window.location = 'uploads.php<?php echo '?id='.$id; ?>';
</script>
<?php
exit();
}
}
} else {
//unsuccessful upload
//echo "Error: A problem occurred during file upload!";
$errmsg_arr[] = 'upload of file ' . $filename . ' was unsuccessful';
$errflag = true;
if ($errflag) {
$_SESSION['ERRMSG_ARR'] = $errmsg_arr;
session_write_close(); ?>

31
<script>
window.location = 'uploads.php<?php echo '?id='.$get_id; ?>';
</script>

<?php
exit();
}
}
} else {
//existing upload
// echo "Error: File ".$_FILES["uploaded_file"]["name"]." already exists";
$errmsg_arr[] = 'Error: File >>' . $_FILES["uploaded_file"]["name"] . '<< already exists';
$errflag = true;
if ($errflag) {
$_SESSION['ERRMSG_ARR'] = $errmsg_arr;
session_write_close(); ?>
<script>
window.location = 'uploads.php<?php echo '?id='.$get_id; ?>';
</script>
<?php

exit();
}
}
} else {
//wrong file upload

32
//echo "Error: Only .jpg images under 350Kb are accepted for upload";
$errmsg_arr[] = 'Error: All file types except .exe file under 5 Mb are not accepted for
upload';
$errflag = true;
if ($errflag) {
$_SESSION['ERRMSG_ARR'] = $errmsg_arr;
session_write_close(); ?>
<script>
window.location = 'uploads.php<?php echo '?id='.$get_id; ?>';
</script>
<?php
exit();
}
}
} else {
//no file to upload
//echo "Error: No file uploaded";

$errmsg_arr[] = 'Error: No file uploaded';


$errflag = true;
if ($errflag) {
$_SESSION['ERRMSG_ARR'] = $errmsg_arr;
session_write_close(); ?>
<script>
window.location = 'uploads.php<?php echo '?id='.$get_id; ?>';
</script>
<?php
exit();

33
}
}

mysql_close();
?>

<?php include('header_dashboard.php'); ?>


<body>
<?php include('navbar.php'); ?>
<div class="container-fluid">
<div class="row-fluid">
<?php include('calendar_sidebar.php'); ?>
<?php
function getId($id){
$id = "user";
$query = "SELECT * FROM `tbluser` WHERE
`user_id` = 111";
$query_announcement = mysql_query($query)or
die(mysql_error());
$count_my_message =
mysql_num_rows($query_announcement);
if ($count_my_message != '0'){
while($row =
mysql_fetch_array($query_announcement)){
$id = $row['username'];
}
}

34
return $id;

?>
<div class="span6" id="content">
<div class="row-fluid">
<!-- breadcrumb -->
<ul class="breadcrumb">
<li><a href="#">User</a><span
class="divider">/</span></li>
<li><a href="#">Message</a><span
class="divider">/</span></li>
<li><a href="#"><b>Inbox</b></a></li>
</ul>

<div id="block_bg" class="block">


<div class="navbar navbar-inner block-header">
<div id="" class="muted pull-left"></div>
</div>
<div class="block-content collapse in">
<div class="span12">
<form action="read_message.php"
method="post">
<div class="pull-right">

35
<script>
$("#checkAll").click(function () {

$('input:checkbox').not(this).prop('checked', this.checked);
});
</script>

</div>

<ul class="nav nav-pills">


<li class=""><a href="#"><i
class="icon-envelope-alt"></i>Receiver Message</a></li>
<li class=""
style="float:right;"><a href="#"><i class="icon-envelope-alt"></i>Sender messages</a></li>
</ul>

<?php
//echo "message : ".
/*
select * from message LEFT JOIN
tbluser ON tbluser.user_id = message.sender_id where message.reciever_id = '2' or
message.sender_id = '2' order by date_sended DESC

*/

$cur_id = $_SESSION['id'];

36
$query = "select * from message
LEFT JOIN vendor_reg ON vendor_reg.id = message.sender_id where message.reciever_id =
'$session_id' or message.sender_id = '$session_id'order by date_sended DESC";
$query_announcement =
mysql_query($query)or die(mysql_error());
$count_my_message =
mysql_num_rows($query_announcement);
if ($count_my_message != '0'){
while($row =
mysql_fetch_array($query_announcement)){
$id = $row['message_id'];
$id_2 = $row['message_id'];
$status = $row['message_status'];
$sender_id = $row['sender_id'];
$sender_name = $row['sender_name'];
$reciever_name = $row['reciever_name'];
if($sender_id == $cur_id){
$sender_name = "Me";
}
if($sender_name == ""){
$sender_name = getId($sender_id);
}
?>
<div class="post"
id="del<?php echo $id; ?>">
<div
class="message_content" >
<strong><?php echo
$sender_name; ?></strong> : <?php echo $row['content']; ?>
</div>

37
<div class="pull-
right">

</div>
<hr>

<i class="icon-
calendar"></i> <?php echo $row['date_sended']; ?>

<!--<div class="pull-right">

<a id="reply_msg" class="btn btn-link" href="#reply<?php echo $id; ?>" data-


toggle="modal" ><i class="icon-reply"></i> Reply </a>

</div>-->
<div
class="pull-right">
<a
class="remove_msg btn btn-link" id="<?php echo $id; ?>" href="#<?php echo $id; ?>" data-
toggle="modal" ><i class="icon-remove"></i> Remove </a>
</div>
</div>

<?php }}else{ ?>


<div class="alert alert-info"><i class="icon-
info-sign"></i> No Message Inbox</div>
<?php } ?>
</form>
</div>
</div>
</div>

38
<!-- /block -->
</div>

<script type="text/javascript">
$(document).ready( function() {
$('.remove_msg').click( function() {
var id = $(this).attr("id");
$.ajax({
type: "POST",
url: "remove_inbox_message.php",
data: ({id: id}),
cache: false,
success: function(html){
$("#del"+id).fadeOut('slow', function(){ $(this).remove();});
$('#'+id).modal('hide');
$.jGrowl("Your Sent message is Successfully Deleted", { header: 'Data Delete' });
}
});
return false;
});
});
</script>
<script>
jQuery(document).ready(function(){
jQuery("#reply_msg").click(function(e){
e.preventDefault();
var id = $('.reply').attr("id");

39
var _this = $(e.target);
var msg = prompt("Enter Your Msg","write here ..");
$.ajax({
type: "POST",
url: "reply.php",
data: ({msg:msg, id:id}),
success: function(html){
$.jGrowl("Message Successfully Sent", { header: 'Message
Sent' });
$('#reply'+id).modal('hide');
}

});
return false;
});
});
</script>

</div>
<?php include('create_message_form.php') ?>
</div>
<?php include('footer.php'); ?>
</div>
<?php include('script.php'); ?>
</body>
</html>

40
REFERENCE

1. Bowell, V A; Rennie, L J; Tierney, G; Lawrence, A B; Haskell, M J, "


Relationships between building design, management system and dairy trading"
Volume 12, Number 4, November 2003, pp. 547-552(6).

2. R.B.M. Hurine, Hollandsewg (2016) "A New Dairy Control and Management
System in the Automatic Milking Farm: Basic Concepts and Components" Vol.12
pp.129-227.

3. Shimpei Matsumoto †and Hiroaki Ishii,(2010)" Evaluation of Menu Planning


Capability Based on Multi-dimensional 0/1 Knapsack Problem of Nutritional
Management System", Vol.12,pp.99-123

4. Tomoko Kashimaa, " Development of Web‐Based Menu Planning Support


System and its Solution Using Genetic Algorithm" AIP, Vol.7, pp.1174, 56 (2009)

5. Vivi M. Thorup1, , Mizeck G.G. Chagunda, Amelie Fischer3, Martin R.


Weisbjerg, (2018) " Robustness and sensitivity of a blueprint for on-farm
estimation of dairy balance". Vol.01,pp 37-66

41

Вам также может понравиться