Jump to content

Search the Community

Showing results for tags 'php jquery'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 2 results

  1. Hi there - Im busy putting together a basic POS system for a client. Thing is all my prev work has been online, so now I have to face several challenges getting this to work in all circumstances - I want your opinion if this seems to be a fairly legit approach - bear in mind im not familiar with any frameworks - I code ground up procedural style with functions (have been for years - and now is not the time to lecture me about it or digress - please bear with me).. Lets briefly cover the main operations of the POS system: Read current products / prices / stock Create supplier orders / receive orders / process new stock (to reflect on all other systems / locations) Capture customer orders and counter sales / invoices etc In a perfect world this will all run directly from/to the main online server - from any terminal anywhere with complete data synchronicity across all terminals. Now in one location there might be say - 3 stations and a local server.. So this is my plan of action: The Main live server will be the primary data source (ultimately) Each physical location will have a local server (network shared) <- more on this below Each POS terminal will / must be able to run the data without even a network connection Problem 1 / Solution: Now lets say the internet connection drops - Now we have a situation where the main server is unreachable.. The terminals and server now have no connectivity to the products etc - and are operating "blind". My solution is to store a copy of all products in a json/xml/csv file on the main server - so when the system goes offline they switch immediately to the local stored copies. This will be a fixed filename on the local server read only to all POS stations - so they can continue pulling products. (bear in mind this will apply to suppliers, orders, whatever else will be need to perform the base functions). Problem 2 / Solution: Similar as above - except now the POS station is running completely as a single unit. Once again - there will be a copy of the json/xml files stored locally to read from. For each of the above cases - there will also be a unique json/xml/csv file for new captures - ie, a new supplier order from a single station would be stored into the local file a new product created would also be stored locally soon as the local server is accessible a sync can be done as soon as the main server becomes available - a sync can be done to that unique transaction and operation codes will be created to avoid duplicate entries. So in scenario 1 - all POS stations will be saving to the main local server, in scenario two they will be storing everything to local files. When reading / writing the files - i will create php arrays and loop each one, look for a duplicate in table and insert / clear file - so each insert / sync will be removed from local file - be it station to local server, station to main server, or local server to live server. Im not sure if theres a magic button to press that could sync a mysql database - the reason Im using files is because: the use of files might bypass certain security issues sharing data between mutliple sources faster performance using files rather than running a db server on station, local server AND live server the product list is only about 3-4 thousand and maybe i can cache the files plus i dont think they would be too big? In a nutshell - if connectivity is lost, the system will resort to using flat files.. One argument against is perhaps it might be easier to have the same databases all over, then the code wont change - just the location / db server.. that could be a very small piece of code. Id just have to magically sync the dbs tho... this is one issue im having to consider - flat files vs db - So thats the short of it - id like to know some suggestions, queries and comments - if you think I should consider a different approach please let me know what you think - many thanks! aaarr
  2. I have written code to move records up and down but it does not work and I have tried it on simple table it works fine can anyone help what is problem in my code? if ((empty($_POST))&&(empty($_GET))) { list_users(); die(); } function list_users() { echo "<form method='post'> <table width='50' align='right' border='0' cellspacing='0' cellpadding='0'> <tr> <td colspan='2' align='center'>"; ?> <?php if(isset($_SESSION['username'])) { $s="Hello,".$_SESSION["username"]; $r=$_SESSION["userrole"]; echo $s; } echo "<a href='logout.php' id='logout'>Logout</a></td> </tr> </table> <table width='600' align='center' cellpadding='0' cellspacing='0' border='1' id='tableID'> <tr><td colspan='7' align='center' style='font-size:18px; font-weight:bold;'>Displayed Data</td></tr> <tr><td colspan='7'><a href='".$_SERVER['PHP_SELF']."?action=add'>Add a new contact</a></td></tr>"; $y = 0; $sortDefault = 'id'; // select array $sortColumns = array('id','first_name','last_name'); // select query with sort $sort = isset($_GET['sort']) && in_array($_GET['sort'], $sortColumns) ? $_GET['sort'] : $sortDefault; $order = (isset($_GET['order']) && strcasecmp($_GET['order'], 'DESC') == 0) ? 'DESC' : 'ASC'; $sql = "select * from contacts ORDER BY $sort $order"; $result = mysql_query($sql) or die ("Can't run query because ". mysql_error()); if (mysql_num_rows($result)){ (($y % 2) == 0) ? $bgcolor = "#8FBC8F" : $bgcolor=" #9ACD32"; echo " <tr style='background-color:#5CB3FF' align=center>";?> <!-- <td><input type='checkbox' id='all' name='mainchk' /></td>--> <td>Chk</td> <td><a href='?sort=first_name&order=<?php echo $order =='DESC' ? 'ASC' : 'DESC' ?>'>Name</a></td> <td><a href='?sort=last_name&order=<?php echo $order =='DESC' ? 'ASC' : 'DESC' ?>'>LastName</td> <td><a href='?sort=email&order=<?php echo $order =='DESC' ? 'ASC' : 'DESC' ?>'>Email</td> <td>Status</td> <td>Move</td> <td id="actid">Action</td> <?php "</tr>"; while($rows = mysql_fetch_assoc($result)){ $name = $rows['first_name']; $lname = $rows['last_name']; $email = $rows['email']; $status = $rows['contact_status']; $id = $rows['id']; ($status == 0) ? $status = "Available to contact" : $status = "Do not contact at present."; echo"<tr align=center style='background-color:#C0C0C0'> <td><input type='checkbox' value='$id' name='data[]' id='data'></td> <td>$name</td> <td>$lname</td> <td>$email</td> <td>$status</td> <td><a href='#' class='up'>Up</a><a href='#' class='down'>Down</a></td> <td><a href='".$_SERVER['PHP_SELF']."?action=delete&id=$id' class='confirmation'><img src='delete.png' height='16px' width='16px'></a> <a href='".$_SERVER['PHP_SELF']."?action=edit&id=$id'><img src='write.png' height='16px' width='16px'></a></td> <tr>"; $y++; } echo"</table>"; } else { echo "<tr><td colspan='2' align='center'><b>No data found.</b></td></tr>"; } echo"<div align='center' width='50' ><a href='#' id='all' name='mainchk'>CheckAll/UnCheckAll</a> <input type='image' src='delete.png' alt='Submit' width='16px' height='16px' id='delete'> <input type='image' src='write.png' alt='Submit' width='16px' height='16px' id='editbulk'> </div></form>"; } //Jquery for moving records up & down $(".up,.down").click(function(){ var row = $(this).parents("tr:first"); if ($(this).is(".up")) { row.insertBefore(row.prev()); } else { row.insertAfter(row.next()); } });
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.