CluesShop.com

Wednesday, 2 April 2014

media print css

<style type="text/css" media="print">
          @media print{
             @page {
  size: auto;   /* auto is the initial value */
  margin: 10%;
}
      @page :first {
  margin-left: 2mm;
}
   body * { visibility: hidden; }
  .printconfirmationdiv * { visibility: visible; }
  .printconfirmationdiv { position: absolute; top:40px;}
  .confirmationContainerright * { display:none; }
  .confirmationContainerleft{width:100% !important; }
  .bookingTicketDetails{width:80% !important;}
  .printcss{width:80% !important;}
  .printcssfee{width:80% !important;}
 
   a{display: none ; }
    </style>

<a href="#" onclick="window.print();">

Tuesday, 18 March 2014

form validation using drupal7 using rules


            $('#feedbackform').validate({
                rules: {
                    feedbackFirstName: {
                        required: true
                    },
                    feedbackLastName: {
                        required: true
                    },
                    feedbackEmail: {
                        required: true,
                        email: true
                    },
                    feedbackConfirmemail: {
                        required: true,
                        email: true,
                        equalTo: "#feedbackEmail"
                    },
                    feedbackDescription: {
                        required: $(this).addClass('error'),
                        minlength: 1,
                        maxlength: 35
                    }
                },
                messages: {
            }

            });
/////////////////////

 <form id="feedbackform" name="feedbackform">
    <div class="modal-body">
        <div class="row-fluid">
            <div class="span12">
                We would love to hear your thoughts, concerns or problems with anything so we can improve!<br>
                <small> Required fields*</small>


                <div class="row-fluid">
                    <div class="span12">
                        
                            <fieldset>

                                <div class="row-fluid">
                                    <div class="span12">
                                        <br>
                                        <label>Feedback Type</label>
                                        <div class="row-fluid">
                                            <div class="span3"> <label class="radio">
                                                    <input type="radio" name="feedbacktype" value="Comments" checked> Comments
                                                </label></div>
                                            <div class="span3">
                                                <label class="radio">
                                                    <input type="radio" name="feedbacktype" value="Bug Reports"> Bug Reports
                                                </label>

                                            </div>
                                            <div class="span3">
                                                <label class="radio">
                                                    <input type="radio" name="feedbacktype" value="Questions"> Questions
                                                </label>

                                            </div>
                                        </div><!-- row-fluid end -->


                                    </div>
                                </div><!-- row-fluid end -->
                                <hr/>
                                <div class="row-fluid">
                                    <div class="span12">
<!--                                         <label ></label> -->
                                        <textarea placeholder="*Describe Feedback" rows="4" class="textareaStyle" id="feedbackDescription" name="feedbackDescription"></textarea>

                                    </div>
                                </div><!-- row-fluid end -->
                                <hr/>
                                <div class="row-fluid">
                                    <div class="span6">
<!--                                         <label></label> -->
                                        <input type="text" placeholder="*First Name" class="inputfieldSmall inputfiledStyle" name="feedbackFirstName" id="feedbackFirstName"/>

                                    </div>
                                    <div class="span6">
<!--                                         <label></label> -->
                                        <input type="text" placeholder="*Last Name" class="inputfieldSmall inputfiledStyle" name="feedbackLastName" id="feedbackLastName"/>

                                    </div>
                                </div><!-- row-fluid end -->
<!--                                 <hr/> -->
                                <div class="row-fluid">
                                    <div class="span6">
<!--                                         <label>*</label> -->
                                        <input type="text" placeholder="*Email" class="inputfieldSmall inputfiledStyle" name="feedbackEmail" id="feedbackEmail"/>

                                    </div>
                                    <div class="span6">
<!--                                         <label>*</label> -->
                                        <input type="text" placeholder="*Confirm Email" class="inputfieldSmall inputfiledStyle" name="feedbackConfirmemail" id="feedbackConfirmemail"/>

                                    </div>
                                </div><!-- row-fluid end -->

                            </fieldset>

                    </div>

                </div><!-- row-fluid end -->

            </div>
        </div><!-- row-fluid end -->
    </div>
    
    <div class="modal-footer">
        <!--<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>-->
        <!--                <button class="btn btn-primary" id="feedback">Submit</button>-->
        <!--feedbackformSubmit-->
        <span class="loadergif" style="display:none;"><img src="<?php echo base_path() . path_to_theme(); ?>/assets/img/status-active.gif" /></span> 
        <!--<input type="button" class="btn btn-primary" id="feedbackformSubmit" value="Submit"/>-->
        <div class="requestbutton">
            <input type="button" class="requestbuttonInner" id="feedbackformSubmit" value="Submit"/>
        </div>
    </div>
    </form>
</div>

Wednesday, 26 February 2014

adding link to drupal7

 $form['password']=array(
      '#type' => 'link',
      '#markup' => '',
       '#title' => t('Forgot Password'),
       '#href' => 'user/password',
   );

Monday, 24 February 2014

multiple back in drupal7 using from_state

function scheduledevents_add_form($form, &$form_state, $scheduledevents) {
    // unset($_SESSION['fromtemplateview']);
      //global $base_url;
     // $path='';
     // $_SESSION['currentpage']
  //$_SESSION['flag']=false;
 
  if(!isset($form_state['page'])){
   // if($_SESSION['flag']==false){
  if(isset($_SERVER['HTTP_REFERER'])){
   $str=$_SERVER['HTTP_REFERER'];
   $t=explode('admin', $str);
   $schedulepagepath='admin'.$t[1];
   $form_state['page']['flag']=true;
   if($schedulepagepath=="admin/structure/cruise/manage"){
       $form_state['page']="admin/structure/cruise/manage";
        //var_dump('tre');
   }else{
     //  var_dump('fa');
      $form_state['page']="cruiseeventlist";
   }
  
  }
 //}
  }

sessions in drupal7 back for multiple

function scheduledevents_add($cruisetemplateid) {
   
    $cruise=cruise_load($cruisetemplateid);
 $title = ucwords($cruise->cruise_title);
 drupal_set_title($title, $output = CHECK_PLAIN);

//   if (isset($_SERVER['HTTP_REFERER'])) {
//  echo "<a href=".$_SERVER['HTTP_REFERER'].">Back</a>";
//    }


 $_SESSION['fromtemplateview']=true;

}

function scheduledevents_add_form($form, &$form_state, $scheduledevents) {
   
    global $base_url;
    if(isset($_SESSION['fromtemplateview'])){
        $path=$GLOBALS['base_url'] .'/admin/structure/cruise/manage';
        unset($_SESSION['fromtemplateview']);
    }else{
        $path=$GLOBALS['base_url'].'/cruiseeventlist';
    }
}

$form['back']=array(
        '#type' => 'markup',
        '#markup' =>'<div> <a style="font-size:120%;" href="'.$path.'"> < Back to Events List</a> </div>',
      
    );

Sunday, 23 February 2014

back link

 $form['back']=array(
        '#type' => 'markup',
        '#markup' =>'<div> <a style="font-size:120%;" href="'.$_SERVER['HTTP_REFERER'].'"> < Back to Events List</a> </div>',
       
    );

drupal 7 title dyanic

 $cruise=cruise_load($cruisetemplateid);
 $title = ucwords($cruise->cruise_title);
 drupal_set_title($title, $output = CHECK_PLAIN);