Saturday 10 October 2015

Basic CRUD Application

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Basic CRUD Application - jQuery EasyUI CRUD Demo</title>
  6. <link rel="stylesheet" type="text/css" href="http://www.jeasyui.com/easyui/themes/default/easyui.css">
  7. <link rel="stylesheet" type="text/css" href="http://www.jeasyui.com/easyui/themes/icon.css">
  8. <link rel="stylesheet" type="text/css" href="http://www.jeasyui.com/easyui/themes/color.css">
  9. <link rel="stylesheet" type="text/css" href="http://www.jeasyui.com/easyui/demo/demo.css">
  10. <script type="text/javascript" src="http://code.jquery.com/jquery-1.6.min.js"></script>
  11. <script type="text/javascript" src="http://www.jeasyui.com/easyui/jquery.easyui.min.js"></script>
  12. </head>
  13. <body>
  14. <h2>Basic CRUD Application</h2>
  15. <p>Click the buttons on datagrid toolbar to do crud actions.</p>
  16. <table id="dg" title="My Users" class="easyui-datagrid" style="width:700px;height:250px"
  17. url="get_users.php"
  18. toolbar="#toolbar" pagination="true"
  19. rownumbers="true" fitColumns="true" singleSelect="true">
  20. <thead>
  21. <tr>
  22. <th field="firstname" width="50">First Name</th>
  23. <th field="lastname" width="50">Last Name</th>
  24. <th field="phone" width="50">Phone</th>
  25. <th field="email" width="50">Email</th>
  26. </tr>
  27. </thead>
  28. </table>
  29. <div id="toolbar">
  30. <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="newUser()">New User</a>
  31. <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-edit" plain="true" onclick="editUser()">Edit User</a>
  32. <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-remove" plain="true" onclick="destroyUser()">Remove User</a>
  33. </div>
  34. <div id="dlg" class="easyui-dialog" style="width:400px;height:280px;padding:10px 20px"
  35. closed="true" buttons="#dlg-buttons">
  36. <div class="ftitle">User Information</div>
  37. <form id="fm" method="post" novalidate>
  38. <div class="fitem">
  39. <label>First Name:</label>
  40. <input name="firstname" class="easyui-textbox" required="true">
  41. </div>
  42. <div class="fitem">
  43. <label>Last Name:</label>
  44. <input name="lastname" class="easyui-textbox" required="true">
  45. </div>
  46. <div class="fitem">
  47. <label>Phone:</label>
  48. <input name="phone" class="easyui-textbox">
  49. </div>
  50. <div class="fitem">
  51. <label>Email:</label>
  52. <input name="email" class="easyui-textbox" validType="email">
  53. </div>
  54. </form>
  55. </div>
  56. <div id="dlg-buttons">
  57. <a href="javascript:void(0)" class="easyui-linkbutton c6" iconCls="icon-ok" onclick="saveUser()" style="width:90px">Save</a>
  58. <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#dlg').dialog('close')" style="width:90px">Cancel</a>
  59. </div>
  60. <script type="text/javascript">
  61. var url;
  62. function newUser(){
  63. $('#dlg').dialog('open').dialog('center').dialog('setTitle','New User');
  64. $('#fm').form('clear');
  65. url = 'save_user.php';
  66. }
  67. function editUser(){
  68. var row = $('#dg').datagrid('getSelected');
  69. if (row){
  70. $('#dlg').dialog('open').dialog('center').dialog('setTitle','Edit User');
  71. $('#fm').form('load',row);
  72. url = 'update_user.php?id='+row.id;
  73. }
  74. }
  75. function saveUser(){
  76. $('#fm').form('submit',{
  77. url: url,
  78. onSubmit: function(){
  79. return $(this).form('validate');
  80. },
  81. success: function(result){
  82. var result = eval('('+result+')');
  83. if (result.errorMsg){
  84. $.messager.show({
  85. title: 'Error',
  86. msg: result.errorMsg
  87. });
  88. } else {
  89. $('#dlg').dialog('close'); // close the dialog
  90. $('#dg').datagrid('reload'); // reload the user data
  91. }
  92. }
  93. });
  94. }
  95. function destroyUser(){
  96. var row = $('#dg').datagrid('getSelected');
  97. if (row){
  98. $.messager.confirm('Confirm','Are you sure you want to destroy this user?',function(r){
  99. if (r){
  100. $.post('destroy_user.php',{id:row.id},function(result){
  101. if (result.success){
  102. $('#dg').datagrid('reload'); // reload the user data
  103. } else {
  104. $.messager.show({ // show error message
  105. title: 'Error',
  106. msg: result.errorMsg
  107. });
  108. }
  109. },'json');
  110. }
  111. });
  112. }
  113. }
  114. </script>
  115. <style type="text/css">
  116. #fm{
  117. margin:0;
  118. padding:10px 30px;
  119. }
  120. .ftitle{
  121. font-size:14px;
  122. font-weight:bold;
  123. padding:5px 0;
  124. margin-bottom:10px;
  125. border-bottom:1px solid #ccc;
  126. }
  127. .fitem{
  128. margin-bottom:5px;
  129. }
  130. .fitem label{
  131. display:inline-block;
  132. width:80px;
  133. }
  134. .fitem input{
  135. width:160px;
  136. }
  137. </style>
  138. </body>
  139. </html>

How to Integrate Stripe Payment Gateway in PHP







Step 3.
Edit charge.php file and replace with your Secret Key
Edit index.php file and replace with your Publishable Key
The test version does not entail actual transfer of funds and you can teste transfer if you have set up everything necessary to charge a customer by entering the following credit card number: 4242424242424242.
The only thing you would have to worry is Man-in-the-middle attacks and that is why Stripe highly recommends using HTTPS but no data about a card will be stored in your server.
First, we create a basic static web page and create a form that includes a script from Stripe (Checkout.js).

<?php

//let's say each article costs 15.00 bucks

try {
  require_once('Stripe/lib/Stripe.php');
  Stripe::setApiKey("secret_key_here"); //Replace with your Secret Key

  $charge = Stripe_Charge::create(array(
  "amount" => 1500,
  "currency" => "usd",
  "card" => $_POST['stripeToken'],
  "description" => "Charge for Facebook Login code."
));
    //send the file, this line will be reached if no error was thrown above
    echo "<h1>Your payment has been completed. We will send you the Facebook Login code in a minute.</h1>";


//you can send the file to this email:
echo $_POST['stripeEmail'];
}
//catch the errors in any way you like

catch(Stripe_CardError $e) {
   
}


catch (Stripe_InvalidRequestError $e) {
// Invalid parameters were supplied to Stripe's API

} catch (Stripe_AuthenticationError $e) {
// Authentication with Stripe's API failed
// (maybe you changed API keys recently)

} catch (Stripe_ApiConnectionError $e) {
// Network communication with Stripe failed
} catch (Stripe_Error $e) {

// Display a very generic error to the user, and maybe send
// yourself an email
} catch (Exception $e) {

// Something else happened, completely unrelated to Stripe
}
?>

  $charge = Stripe_Charge::create(array(
  "amount" => 1500,
  "currency" => "usd",
  "card" => $_POST['stripeToken'],
  "description" => "Charge for Facebook Login code."
));
Signup on stripe

Monday 13 April 2015

Using BootStrap 3 Table in ASP.NET


Microsoft open sources more of its .Net technologies

In a move few would have ever imagined coming to pass, Microsoft is open sourcing more of its .Net developer framework and programming languages.
opensourcedotnet
Company officials announced the move on April 3 at Microsoft's Build 2014 developer conference. Execs also revealed they are partnering with Xamarin to create a new .Net Foundation, which will be responsible for the newly open-sourced bits.
Microsoft already helped create another foundation for open-sourcing its technologies, the Outercurve Foundation. It's not clear why Microsoft didn't simply use Outercurve as the vehicle for this latest round of open-sourcing. Update: Microsoft Developer Division chief Soma Somasegar said Microsoft decided creating a separate, completely .Net-focused foundation would be the quickest and most impactful way to get open-source process for .Net moving. He also said Microsoft is considering how and if to work with Outercurve on this project, or whether it makes more sense to keep the .Net Foundation separate.
Among the 24 current and future technologies Microsoft will be contributing to the .Net Foundation are ASP.Net, the Entity Framework, a preview of the .Net Compiler Platform (codenamed "Roslyn") , the VB and C# programming languages, the .Net Micro Framework, and .Net Rx. Xamarin, a maker of cross-platform mobile development tools, is contributing its MimeKit and Mailkit libraries, Xamarin Mobile, Xamarin Auth and more.
Here's a slide from Build 2014 listing all the open-sourced .Net Foundation technologies (so far):
dotnetfoundation
Going forward, Microsoft expects to release as open source more of its .Net components and libraries via the new foundation. It also is seeking contributions from commercial vendors and members of the .Net community. Members of the .Net Foundation "community"/include Xamarin's Miguel de Icaza, representatives from Glimpse, Umbraco, IdentityMine, GitHub and a handful of other companies.

Build 2014

  • Microsoft to bring back Start menu, windowed apps to Windows
  • What Windows 8 should have been from the start
  • Microsoft shows off Cortana beta
  • Microsoft finds its $0 Windows Phone business model
Microsoft officials say there are more than 6 million developers using .Net, and that there are 1.8 billion installs of .Net across various devices.
Microsoft has open-sourced a number of its developer tools and technologies in recent years. The company has released under various open source licenses the bulk of ASP.NET, MVC, Web API, Entity Framework, SignalR, VS Web Essentials, the Azure software development kit and more.
Microsoft also made available today an end-user preview of the .NET Compiler Platform project, previously known as "Roslyn." Roslyn includes the next versions of the C# and VB compilers , as well as a compiler-as-a-service programming interface. And on April 2, Microsoft execs also announced the company is open sourcing WinJS, its Windows library for JavaScript.

Friday 3 April 2015

Cygnet eCommerce Solution




eCommerce Solution

 

To give your customers a smooth shopping experience, our eCommerce consultants craft your solution with superior design elements having high usability. We build secure and stable solution so that your customers can shop with confidence. Our developers create admin panel that is feature-rich yet simple to use.

 

QA Testing

 

Our QA team pours their years of experience into testing every aspect of your solution from multiple scenarios so that you get the best quality eCommerce solution developed. We follow industry benchmarks for quality solution development. This ensures your solution works on peak performance without any glitches.