Permalink
Browse files

Merge branch 'master' of github.com:harshals/CRM

  • Loading branch information...
2 parents e2093c8 + eea5619 commit ccbfd07cf61862b047a0a710c1b5b3d7e43cc086 @roshandarekar roshandarekar committed Mar 12, 2011
Showing with 224 additions and 406 deletions.
  1. +1 −1 app.psgi
  2. +2 −0 config.yml
  3. +33 −1 lib/App.pm
  4. +65 −259 logs/development.log
  5. +0 −1 public/views/index.html
  6. BIN var/master.db
  7. +2 −3 views/index.tt
  8. +1 −1 views/login.tt
  9. BIN views/pdf/empty.pdf
  10. +8 −0 views/pdf/temp.tt
  11. +112 −140 views/register.tt
View
@@ -36,7 +36,7 @@ set 'log' => 'debug';
set 'traces' => 1;
-set "template" => "simple";
+set "template" => "template_toolkit";
my $app = sub {
my $env = shift;
View
@@ -11,3 +11,5 @@ plugins:
app_id: 1
register_message_subject: Welcome to Adhril.com
+
+pdf_dir: views/pdf
View
@@ -16,6 +16,13 @@
#===============================================================================
package App;
+
+use File::chdir;
+use File::Spec::Functions qw/catfile rel2abs/;
+use File::Temp qw/tmpnam/;
+use PDF::Reuse;
+
+
use strict;
use warnings;
@@ -30,7 +37,7 @@ before sub {
};
get '/' => sub {
-
+
template 'index';
};
@@ -39,6 +46,31 @@ get '/debug' => sub {
return { data => vars->{serialize_options} };
};
+get '/pdf/:path' => sub {
+
+ my $filename = params->{'path'};
+
+ send_error({error => 'No PDF dir defined ' }) unless -d config->{'pdf_dir'};
+
+ my $pdf = config->{'pdf_dir'} . "/" . $filename . ".tt";
+
+ send_error({error => 'No PDF template defined' }) unless -f $pdf;
+
+ content_type 'application/pdf';
+
+ eval {
+ template $pdf, { pdf_template => "$filename.pdf" };
+ };
+
+ if ($@) {
+
+ debug $@;
+ }
+
+ debug "coming here roo";
+
+};
+
1;
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -1 +0,0 @@
-Hello world
View
Binary file not shown.
View
@@ -151,8 +151,7 @@
<!-- menu -->
<div class="grid_24" id="main-menu">
<ul >
- <li class="" ><a href="#/home" name=
- "current">Home</a></li>
+ <li class="" ><a href="#/home" name= "current">Home</a></li>
<li><a href="#/task">Tasks</a></li>
@@ -161,7 +160,7 @@
<li class="right"> <a href="/logout" id="logout">Logout</a></li>
- <li class="right"> <a href="#/profile" id="profile">John Simth</a></li>
+ <li class="right"> <a href="#/profile" id="profile"><% name %></a></li>
</ul>
View
@@ -32,7 +32,7 @@
attempt = (typeof(attempt) != 'undefined' ) ? parseInt(attempt) : 0 ;
console.log(attempt);
- if (attempt > 3 ) {
+ if (attempt > 2) {
$("#reCaptcha").show();
$("#submit").click(function(){
return jcap();
View
Binary file not shown.
View
@@ -0,0 +1,8 @@
+ [% USE pdf = Catalyst::View::PDF::Reuse %]
+
+ [% pdf.prFile('empty.pdf' ) %]
+
+ [% pdf.prText(100, 500, 'Hello World !') %]
+
+ [% pdf.prEnd() %]
+
View
@@ -11,11 +11,6 @@
"text/html; charset=iso-8859-1" />
<meta name="description" content="App Name app" />
<meta name="keywords" content="App Name" />
- <!-- <link rel="stylesheet" href="css/reset.css" type="text/css" /> -->
- <!-- <link rel="stylesheet" href="css/text.css" type="text/css" />-->
-
- <!-- <link rel="stylesheet" href="css/960_24_col.css" type="text/css" /> -->
-
<link rel="stylesheet" href="css/style.css" type="text/css" />
<link rel="stylesheet" href="css/facebox.css" type="text/css" />
<link rel="stylesheet" href="css/jquery-ui.css" type="text/css" />
@@ -28,136 +23,113 @@
<script type="text/javascript" src="javascript/jquery.validate.js"></script>
<script type="text/javascript">
$(document).ready(function() {
- //--------------------------------registar form --------------------------
- $("#regi_form").validate({
- rules : {
- first_name: {
- required: true
- },
- last_name: {
- required: true
+//--------------------------------registar form validation------------------------------
+ $("#regi_form").validate({
+ rules : {
+ first_name: {
+ required: true
+ },
+ last_name: {
+ required: true
+ },
+ email: {
+ required: true,
+ email: true
+ },
+ password: {
+ required: true,
+ minlength: 4,
+ maxlength: 15
+ },
+ re_password: {
+ equalTo: '#password'
+ },
+ answer: {
+ required: true
+ },
+ question_id:{
+ required:true
+ }
},
- email: {
- required: true,
- email: true
+ messages : {
+ first_name:"Enter Name",
+ last_name: "Enter SurName",
+ email: "Enter email id",
+ password: "Enter password with atleast 4 charactor",
+ answer: "Enter answer of the question",
+ question_id:"Select your question"
},
- password: {
- required: true,
- minlength: 4,
- maxlength: 15
- },
- re_password {
- equalTo: '#password'
+ errorClass:"small"
+ })
+//------------------------------Form submittion--------------------------------
+ $("#regi_form").submit(function() {
+ var verify = $("#regi_form").find("input[name=verify]").attr("checked");
+ if(!verify) {
+ alert("Please accept our terms and conditions");
+ return false;
}
- answer: {
- required: true
- },
- question_id:{
- required:true
- }
- },
- messages : {
- first_name:"Enter Name",
- last_name: "Enter SurName",
- email: "Enter email id",
- password: "Enter password with atleast 4 charactor",
- answer: "Enter answer of the question",
- question_id:"Select your question"
- },
- errorClass:"small"
- })
-
- $("#regi_form").submit(function() {
-
- var verify = $("#regi_form").find("input[name=verify]").attr("checked");
-
- if(!verify) {
-
- alert("Please accept our terms and conditions");
- return false;
- }
-
-
- var password =$("#regi_form").find("input[name=password]").val();
- var re_pass=$("#regi_form").find("input[name=re_password]").val();
- if(pass=='' & re_pass=='')
- {
- alert("please Enter Your Password")
- }
- else{
- if(pass==re_pass){
- return true
- }
- else{
- alert("please check your password");
- return false;
- }
- }
-
- return jcap();
-
- })
-
+ return jcap();
+ })
})
- </script>
- </head>
- <body>
+ </script>
+ </head>
+ <body>
<div class="container_24" id="content">
- <div class="grid_18 main push_4" id="main-content">
+ <div class="grid_18 main push_4" id="main-content">
<h2>Registration Form</h2>
- <div id="message_box" class="box negative notice grid_15">
- <ul><li><% message %></li></ul>
- </div>
-
-
- <form action="/register" method="POST" class="" id="regi_form" onsubmit="return jcap();">
- <fieldset class="grid_15 blue box ">
- <ul class="form tar">
- <li class="required fat">
- <label>First Name</label>
- <input type="text" name="first_name" value=""/>
- </li>
- <li class="required fat">
- <label >Last Name</label>
- <input type="text" name="last_name" value=""/>
- </li>
- <li class="required fat">
- <label >Email id</label>
- <input type="text" name="email" value=""/>
- </li>
- <li class="required fat">
- <label >Password</label>
- <input type="password" name="password" value="" id="password"/>
- </li>
- <li class="required fat">
- <label >Retype Password</label>
- <input type="password" name="re_password" value="" id="re_password"/>
- </li>
- <li class="required fat">
- <label >Security Question</label>
- <select name="question_id" class="required">
- <option value="">Choose Question</option>
- <option value="q1" >What is the name of your best friend</option>
- <option value="q2" >What is your phone No.</option>
- <option value="q3" >What is your vehicle Registration No.</option>
- <option value="q4">What is your favorite Food</option>
- <option value="q5">What is your lucky number</option>
- </select>
- </li>
- <li class="required fat">
- <label >Answer</label>
- <input type="text" name="answer" value=""/>
- </li>
- <li class="fat">
- <label>Company name</label>
- <input type="text" name="company" value=""/>
- </li>
- <li>
- <script type="text/javascript">sjcap();</script>
- </li>
- <li class="required">
- <label >Terms & Condition</label>
- <textarea rows="2" cols="40" style="font-size:1.3em">
+ <div id="message_box" class="box negative notice grid_15">
+ <ul>
+ <li><% message %></li>
+ </ul>
+ </div>
+ <form action="/register" method="POST" class="" id="regi_form" >
+ <fieldset class="grid_15 blue box ">
+ <ul class="form tar">
+ <li class="required fat">
+ <label>First Name</label>
+ <input type="text" name="first_name" value=""/>
+ </li>
+ <li class="required fat">
+ <label >Last Name</label>
+ <input type="text" name="last_name" value=""/>
+ </li>
+ <li class="required fat">
+ <label >Email id</label>
+ <input type="text" name="email" value=""/>
+ </li>
+ <li class="required fat">
+ <label >Password</label>
+ <input type="password" name="password" value="" id="password"/>
+ </li>
+ <li class="required fat">
+ <label >Retype Password</label>
+ <input type="password" name="re_password" value="" id="re_password"/>
+ </li>
+ <li class="required fat">
+ <label >Security Question</label>
+ <select name="question_id" >
+ <option value="">Choose Question</option>
+ <option value="q1" >What is the name of your best friend</option>
+ <option value="q2" >What is your phone No.</option>
+ <option value="q3" >What is your vehicle Registration No.</option>
+ <option value="q4">What is your favorite Food</option>
+ <option value="q5">What is your lucky number</option>
+ </select>
+ </li>
+ <li class="required fat">
+ <label >Answer</label>
+ <input type="text" name="answer" value=""/>
+ </li>
+ <li class="fat">
+ <label>Company name</label>
+ <input type="text" name="company" value=""/>
+ </li>
+ <li>
+ <script type="text/javascript">sjcap();</script>
+ </li>
+ <li class="required">
+ <label >Terms & Condition</label>
+ <textarea rows="2" cols="40" style="font-size:1.3em">
One of the conditions for all uses is that you cannot mess around with our marks.
Only we get to do that. Do not remove, distort or alter any element Brand Feature.
That includes modifying trademark, for example, through hyphenation, combination or abbreviation
@@ -179,18 +151,18 @@ Do not use our company trademarks in a way that suggests a common, descriptive,
Trademark rights vary from country to country.
Some countries have severe criminal and civil penalties for improper use of the registration symbol.
Therefore, do not use the registration symbol (�) in countries where the mark has not been registered.
- </textarea>
- </li>
- <li class="required" style="margin-left:160px">
- <input type="checkbox" name="verify" value=yes />
- I accept all Terms & Condition
- </li><br>
- <input type="submit" value="I accept,Create my account" id="account" class="button" style="float:none;margin-left:180px" />
- </ul>
- </fieldset>
- </form>
+ </textarea>
+ </li>
+ <li class="required" style="margin-left:160px">
+ <input type="checkbox" name="verify" value=yes />
+ I accept all Terms & Condition
+ </li><br>
+ <input type="submit" value="I accept,Create my account" id="account" class="button" style="float:none;margin-left:180px" />
+ </ul>
+ </fieldset>
+ </form>
</div>
<!-- main content -->
-</div>
+ </div>
</body>
</html>

0 comments on commit ccbfd07

Please sign in to comment.