miércoles, 26 de junio de 2013

JQuery - Timepicker & Datepicker

Timepicker & Datepicker


I took a component from http://trentrichardson.com/examples/timepicker/ to display a calendar that used Jquery.

The steps to install the JQuery plugin

1) Include in your file the following files, this can be done downloading the files or doing the references.

Downloading the Files.
    <script src="../Scripts/Mail/jquery-2.0.2.min.js"></script>
    <script src="../Scripts/Mail/jquery-ui.min.js"></script>
    <link href="../Content/jquery-ui.css" rel="stylesheet" />    
    <script src="../Scripts/Mail/jquery-ui-timepicker-addon.js"></script>

Includinf the references.
    <script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.min.js"></script>
    <script src="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.16/jquery-ui.min.js"></script>
    <link rel="stylesheet" type="text/css" href="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.16/themes/hot-    sneaks/jquery-ui.css" />
    <script src="pathtojs/jquery-ui-timepicker-addon.js"></script>

2) For this plugin additionally request include the following style.

.ui-timepicker-div .ui-widget-header{ margin-bottom: 8px; }
.ui-timepicker-div dl{ text-align: left; }
.ui-timepicker-div dl dt{ height: 25px; }
.ui-timepicker-div dl dd{ margin: -25px 0 10px 65px; }
.ui-timepicker-div td { font-size: 90%; }

3) Include the following function in your file
<script type="text/javascript">
   $(function() { $('#selectedDateTime').datetimepicker(); });
</script>

4) Finally include the element.
<input type="text" id="selectedDateTime" />

5) Optionally if you want to customize the format include in the script section
$('#selectedDateTimeWithFormat').datetimepicker({ dateFormat: 'dd-mm-yy', timeFormat: 'hh:mm:ss' });

martes, 25 de junio de 2013

JQuery Validator plugin


1) This line include JQuery to your project
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/2..2/jquery.min.js"></script>

2) This line include JQuery Validator to your project in .Net
<script type="text/javascript" src="http://ajax.microsoft.com/ajax/jquery.validate/1.5.5/jquery.validate.min.js"></script>

3) In your .aspx file write the next jscript code to validate the empty fields
   #ctl01 is the Id Form
   #MainContent_btn222  is the Id Button


$(document).ready(function () {
    // Initialize validation on the entire ASP.NET form

    $("#ctl01").validate({
        // This prevents validation from running on every
        //  form submission by default.
        onsubmit: false
    });

    $("#MainContent_btn222").click(function (evt) {
        // Validate the form and retain the result.
        var isValid = $("#ctl01").valid();

        // If the form didn't validate, prevent the
        //  form submission.
        if (!isValid)
            evt.preventDefault();
    });
});

4) In your fields add the tag CssClass with the value required

<asp:TextBox ID="To" runat="server" Width="350px" CssClass="required"/>

jueves, 20 de junio de 2013

Regular Expression - Multiple Mails

This expression validated many emails like in Cc.

(\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*[\s,;]*)*

jueves, 30 de mayo de 2013

Moodle - Course

Course

Plugins

Add Reources

In the section
  • Home
  •  /  Courses
  •  / 

     Miscellaneous
  •  /  CourseXXX

you can add many items like labels, Test Surveys, Quizzes, Assignments, etc   

Moodle - Users / Groups

Users


  • To send mails to new user install the plugin welcome
    • Install the folder welcome in htdocs\moodle\local
    • Restart moodle to times to show the pages to update the appliation


Groups


  • The term is referent to indicate that one course is given in many Groups.
  • The users must be enrolled before assign them to a group


Paypal


  1. First, enable the plugin


2. Configured your
  • Home
  •  /  Site administration
  •  /  Plugins
  •  /  Enrolments
  •  /  PayPal

martes, 7 de mayo de 2013

Moodle with SQL Server




Execute the following commands

1)

CREATE LOGIN root WITH PASSWORD = 'Adm1n1234'
,DEFAULT_DATABASE = [moodle]

GO
-- Now add user to database

2)
USE moodle;
CREATE USER root FOR LOGIN root;
GO


3)

  • ALTER DATABASE moodle SET ANSI_NULLS ON


  • ALTER DATABASE moodle SET QUOTED_IDENTIFIER ON


  • ALTER DATABASE moodle SET READ_COMMITTED_SNAPSHOT ON


4)

 Set the following settings in your php.ini file
  • mssql.textlimit = 20971520
  • mssql.textsize = 20971520



lunes, 6 de mayo de 2013

Moodle instalation - Fix Problems


Fix problems
http://moodle-platform.cba.pl/admin/index.php?lang=en&agreelicense=1



SSL problem


admin/environment/php extension/openssl

To install the openssl library on Windows
  1. Open the php.ini file found in the moodle/apache/bin (if not there then, in folder server/php/)
  2. Find the line: ;extension=php_openssl.dll
  3. Remove the ; at the beginning of the line
  4. Restart apache if necessary
Note: if Moodle fails to create a public key in Admin > Networking > Settings, you'll need to configurate your OPENSSL_CONF path. With Windows File Explorer find openssl.cnf file (usually in your php/extras directory). Rename it as openssl.conf. Then set OPENSSL_CONF in your Windows environment variable (example: C:/wamp/bin/php/extras/openssl/openssl.conf - do not forget the file name in the path, otherwise it doesn't work)
To install the openssl library on Unix
  1. You need to recompile PHP from source
  2. add --with-openssl to the command line when you run configure



INTL Problem

admin/environment/php extension/intl

The Internationalization extension (Intl) is a wrapper for the ICU library, a set of C/C++ and Java libraries that provide Unicode and Globalization support for software applications. It enables PHP programmers to perform UCA-conformant collation and date/time/number/currency formatting in their scripts.

MS Windows

To enable this extension add the following line to your php.ini file usually found in /php:
extension=php_intl.dll
And then set the intl.default_locale and intl.error_level directives in your php.ini file.
[intl]
intl.default_locale = en_utf8
intl.error_level = E_WARNING
The intl.error_level directive is optional.
In a WAMP installation it may be required to add the php path (e.g. C:\wamp\bin\php\php5.3.13 or C:\wamp\bin\php\php5.4.3) to the the system PATH so that the module4 could uploaded properly (see http://forum.wampserver.com/read.php?2,80704,82499 for a couple of other approaches).

“icuuc46.dll” file missing error


  • Go to [xampp_path]/php/
  • Select the following 3 files:
    • icudt46.dll
    • icuin46.dll
    • icuuc46.dll
  • Copy & Paste the files in [xampp_path]/apache/bin folder.

Restart APACHE