Friday, June 27, 2025

MCQ Question Kerala Cooperative Society


 * The word "Co-operation" is derived from which language?
   * Latin
 * What does "Operari" mean in the context of "Co-operari"?
   * To work
 * According to the "Old Concept," co-operation is primarily a:
   * Way of life
 * The guiding principle of co-operation is:
   * Self-help through mutual help
 * Which of the following is a characteristic of a Co-operative Enterprise?
   * Voluntary association
 * The principle of "one man one vote" is a characteristic of:
   * Co-operation
 * Co-operation is described as a weapon for the promotion of economic interests of the:
   * Poor
 * A Primary Agricultural Credit Society (PACS) has its area of operation confined to a:
   * Village, Panchayat or Municipality
 * The primary object of PACS is to provide financial accommodation to its members for:
   * Agricultural purposes or allied agricultural activities
 * The most important source of finance for PACS is:
   * Members' deposits
 * What constitutes the most important element of PACS' working capital?
   * Borrowings
 * In the organizational structure of co-operatives, who elects the Managing Committee?
   * The General Body
 * Who is considered the "Founder Father of Urban Co-operative Bank in the world"?
   * Schulz
 * When was Kerala Bank established?
   * November 29, 2019
 * Where is the headquarters of Kerala Bank located?
   * Trivandrum
 * In which year was the Kerala State Co-operative Bank Ltd. included in the 2nd Schedule of the RBI Act 1934?
   * 1966
 * According to the World Co-operative Monitor Report (Jan 2022), Kerala Bank was ranked as number one Co-operative in:
   * Asia
 * On which date were the Kerala State Co-operative Bank and 13 District Co-operative Banks integrated into "Kerala Bank"?
   * November 29, 2019
 * Who officially inaugurated Kerala Bank on December 6, 2019?
   * Pinarayi Vijayan
 * When was ULCCS established?
   * 1925
 * What does ULCCS stand for?
   * Uralungal Labourers’ Mutual Aid and Co-operative Society
 * Where is the headquarters of ULCCS located?
   * Vatakara, Kozhikode
 * Which year did ULCCS become a member of the ICA?
   * 2019
 * When was the 1st Co-operative day celebrated?
   * July 7, 1923
 * In which city was the 1st Co-operative day celebrated?
   * London
 * From which year did the United Nations Organization (UNO) start celebrating Co-operative day?
   * 1995
 * What was the Coops Day slogan on July 1, 2023?
   * Cooperatives for Sustainable Development
 * In India, Co-operative Week is celebrated every year during which dates?
   * November 14th - 20th
 * The celebrations of Co-operative Week in India began on the birth anniversary of which former Prime Minister?
   * Jawaharlal Nehru
 * What is the full form of NABARD?
   * National Bank for Agricultural and Rural Development
 * When was NABARD established?
   * 1982
 * The formation of NABARD was recommended by which committee?
   * CRAFICARD/B. Sivaraman Committee
 * What is the full form of MILMA?
   * Kerala Co-operative Milk Marketing Federation
 * When was MILMA registered?
   * 1980
 * Where is the headquarters of MILMA located?
   * Thiruvananthapuram
 * MILMA's structure is a:
   * 3 Tier Structure
 * What is the publication of MILMA?
   * Ksheera Sandesham
 * Which product is described as MILMA's chocolate brand name?
   * Deliza
 * What is the full form of SURABHI in the context of Kerala co-operatives?
   * Kerala State Handicraft Apex Co-operative Society
 * Where is the headquarters of SURABHI located?
   * Kochi
 * What is the trade name of MATSYAFED products?
   * Matsya
 * What is the mobile fish market started by MATSYAFED in Kollam District called?
   * Anthipacha
 * Which health care product is produced by MATSYAFED to reduce overweight and cholesterol?
   * Chitosan
 * When was HOSPITAL FED registered?
   * 1999
 * Where is the headquarters of HOSPITAL FED located?
   * Kochi
 * Which medical college was the first to be established under the Co-operative sector in India?
   * Pariyaram Medical College
 * What was Pariyaram Medical College initially called?
   * Academy of Medical Sciences (ACME)
 * What is MARKET FED known as?
   * The apex institution of the Marketing Co-operatives in Kerala
 * When was CONSUMER FED registered?
   * September 4, 1965
 * Which brand name is used for notebooks by Consumer Fed?
   * Triveni

MCQ Question Kerala Cooperative Society


 * What is the full form of CRAFICARD?
   Answer: Committee to Review Arrangements For Institutional Credit For Agriculture and Rural Development
 * Who was the Chairman of the CRAFICARD Committee?
   Answer: B. Sivaraman
 * When was the CRAFICARD Committee appointed by RBI?
   Answer: March 30, 1979
 * NABARD's initial capital was contributed equally by:
   Answer: Government of India & RBI
 * What is NABARD's current ownership status?
   Answer: Fully owned by Government of India
 * Which "Operation Flood" was MILMA established in connection with?
   Answer: Operation Flood - 2
 * What is one of MILMA's slogans?
   Answer: "Keralam kanikandunarunna nanma"
 * Where is MILMA's Training Center located?
   Answer: Thrissur
 * What is the name of MILMA's central processing unit?
   Answer: Alappuzha, Punnapra
 * Which MILMA product is a mango-flavored drink?
   Answer: Refresh
 * When was SURABHI registered?
   Answer: September 16, 1964
 * When did SURABHI start functioning?
   Answer: September 21, 1964
 * Where is SURABHI's Craft Development Centre located?
   Answer: Kaloor, Ernakulam
 * What is the name of the store run by MATSYAFED?
   Answer: Vyasa Store
 * What is the name of the fish manure product by MATSYAFED?
   Answer: Nutrifish
 * What is the name of the mobile app launched by MATSYAFED?
   Answer: Fresh Meen
 * How often is the MATSYAFED newsletter "Matsya" published?
   Answer: Once every three months
 * What is the vision of MATSYAFED?
   Answer: Blissful fishers and healthy community
 * When was HOSPITAL FED registered?
   Answer: January 27, 1999
 * When did HOSPITAL FED start functioning?
   Answer: February 27, 1999
 * Where is the Nursing College of HOSPITAL FED located?
   Answer: Thalassery
 * When was Pariyaram Medical College established?
   Answer: March 1993
 * What was Pariyaram Medical College initially called?
   Answer: Academy of Medical Sciences (ACME)
 * Which is the largest multi-disciplinary super specialty hospital in the Co-operative sector in Kerala with ISO certification?
   Answer: EMS Memorial Co-operative Hospital and Research Centre
 * When was MARKET FED converted into an apex Federation of marketing societies?
   Answer: August 10, 1960
 * What is the current headquarters of MARKET FED?
   Answer: Kochi
 * In which year did MARKET FED shift its headquarters to Kochi?
   Answer: 1978
 * What status does MARKET FED hold as an apex society?
   Answer: Export house status
 * Under which Act was CONSUMER FED registered?
   Answer: Travancore Cochin Co-operative Society Act 1951
 * When did CONSUMER FED start functioning?
   Answer: October 7, 1965
 * How many Regional Distribution Centres does CONSUMER FED have?
   Answer: 3
 * What is the name given to CONSUMER FED's Triveni stores, started in 1997?
   Answer: Neethi Store
 * When was the Neethi Medical Store launched by CONSUMER FED?
   Answer: 1998
 * Where is CONSUMER FED's LPG Bottling Plant located?
   Answer: Palakkad
 * What is the name of the LPG brand launched by CONSUMER FED in 2007?
   Answer: Suneethi Gas
 * Where is CONSUMER FED's Triveni Stationery Division located?
   Answer: Kunnamkulam
 * What type of body is the State Co-operative Union (SCU)?
   Answer: Statutory body
 * When was the State Co-operative Union (SCU) established by a gazette notification?
   Answer: November 21, 1970
 * Where is the headquarters of the State Co-operative Union (SCU) located?
   Answer: Thiruvananthapuram
 * What is the highest non-official body of the co-operative movement in Kerala?
   Answer: State Co-operative Union (SCU)
 * Samsthana Sahakarana Bhavan belongs to which entity?
   Answer: State Co-operative Union (SCU)
 * As per which section of the KCS Act 1960 was SCU established?
   Answer: Section 119
 * Who was the first Chairman of SCU?
   Answer: P.G. Menon
 * Who was the first Additional Registrar Secretary of SCU?
   Answer: Kesavan Nair
 * What is the term of the managing committee of SCU from the date of taking charge?
   Answer: 5 years
 * How many members does the managing committee of SCU consist of?
   Answer: 23
 * What is the quorum for the managing committee of SCU?
   Answer: 12
 * What is the area of operation of a Circle Co-operative Union (CCU)?
   Answer: Taluk
 * How many Circle Co-operative Unions (CCU) are there currently in Kerala?
   Answer: 64
 * Who is the Secretary of the CCU?
   Answer: Assistant Registrar (G)

Tuesday, February 2, 2021

Forensic science Exam | KERALA PSC | 2021
















93. What is the function of w subunit of RNA polymerase
(A) Cation binding (B) Promoter binding
(C) Initiation and elongation Y- (D) Subunit association

94. Which one of the following statement is INCORECT regarding the classification of stains ?
(A) Bismark brown is a basic stains
(B) Janus green B and Methylene blue are examples of neutral stains
(C) Eosin is an acidic stain
(D) Neutral red and Janus green are vital stains

95. In eukaryotic cell division, metaphase to anaphase transition is regulated by degradation of
(A) Aurora A Km4/'ase (B) Cyclin B 1
(C) CDK 1 (D) Polo-like Kinase

96. Which of the following statements is INCORRECT in the context of diversity patterns of a species ?
(A) Alpha diversity is diversity within a single communitykA
(B) Beta diversity is a measure of the change in species composition from one community or habitat to another-•
(C) Alpha diversity is the regipnal diversity found among range of communities X in a geographical region 
(D) Gamma diversity is the regional diversity found among range of communities / habitats in a geog hical region

97. Which of the following bacteria has subcellular localization in lysosomes ?
(A) Salmonella tvphi (B) Sheplococcus pneumoniae 
(C) Vibrio cholerae (D) Mycobacterium tuberculosis

98. The presence & distribution of specific mRNAs within a cell can be detected by
(A) Northern blot analysisCfi°1\ (B) In situ hybridization
(C) Real time PCR (D) ELISA

99. The "Red Queen Hypothesis" is related to
(A) The evolutionary arms race between the host and parasite.
(B) The mating order in the harem of a polyganous male
(C) The elimination by deleterious mutations by sexual reproduction
(D) Mate selectin process by a female in a lek

100. Production of excessive amount of corticotropin (ACTH) occur in which of the following diseases ?
(A) Greve's disease (B) Greig's syndrome
(C) Cushing's syndrome (D) Alport syndrome

Thursday, January 21, 2021

List of Nebular Icons Available


<i title="Edit" class="nb-edit" aria-hidden="true"></ 

.nb-minimize,

.nb-maximize,

.nb-help,

.nb-fold,

.nb-danger,

.nb-collapse,

.nb-checkmark-circle,

.nb-e-commerce,

.nb-info,

.nb-expand,

.nb-drops,

.nb-drop,

.nb-volume-mute,

.nb-volume-high,

.nb-trash,

.nb-title,

.nb-tables,

.nb-sunny,

.nb-sunny-circled,

.nb-star,

.nb-square,

.nb-square-outline,

.nb-snowy-circled,

.nb-skip-forward,

.nb-skip-forward-outline,

.nb-skip-backward,

.nb-skip-backward-outline,

.nb-shuffle,

.nb-search,

.nb-roller-shades,

.nb-rainy,

.nb-power,

.nb-power-circled,

.nb-plus,

.nb-plus-circled,

.nb-play,

.nb-play-outline,

.nb-phone,

.nb-person,

.nb-pause,

.nb-pause-outline,

.nb-partlysunny,

.nb-paper-plane,

.nb-notifications,

.nb-menu,

.nb-loop,

.nb-loop-circled,

.nb-locked,

.nb-location,

.nb-list,

.nb-lightbulb,

.nb-layout-two-column,

.nb-layout-sidebar-right,

.nb-layout-sidebar-left,

.nb-layout-one-column,

.nb-layout-default,

.nb-layout-centre,

.nb-keypad,

.nb-home,

.nb-heart,

.nb-grid-b,

.nb-grid-b-outline,

.nb-grid-a,

.nb-grid-a-outline,

.nb-gear,

.nb-flame-circled,

.nb-email,

.nb-edit,

.nb-compose,

.nb-coffee-maker,

.nb-cloudy,

.nb-close,

.nb-close-circled,

.nb-chevron-up,

.nb-chevron-up-outline,

.nb-chevron-right,

.nb-chevron-right-outline,

.nb-chevron-left,

.nb-chevron-left-outline,

.nb-chevron-down,

.nb-chevron-down-outline,

.nb-checkmark,

.nb-bar-chart,

.nb-audio,

.nb-arrow-up,

.nb-arrow-thin-up,

.nb-arrow-thin-right,

.nb-arrow-thin-left,

.nb-arrow-thin-down,

.nb-arrow-right,

.nb-arrow-retweet,

.nb-arrow-left,

.nb-arrow-dropup,

.nb-arrow-dropright,

.nb-arrow-dropleft,

.nb-arrow-dropdown,

.nb-arrow-down,

.nb-angle-double-right,

.nb-angle-double-left,

.nb-alert

Toastr doesn't appear nebular theme | angular 7

 While navigating from one page to another pages the toastr not working

Temporary Work around:

Go to node_modules/@nebular/theme/components/toastr/toastr.service.js
Go to line no:103
NbToastrContainerRegistry.prototype.get = function (position) {
var logicalPosition = this.positionHelper.toLogicalPosition(position);
// if (!this.overlays.has(logicalPosition)) {
this.instantiateContainer(logicalPosition);
// }
return this.overlays.get(logicalPosition);
};

Tuesday, September 15, 2020

Javascript Helpers for urgent reference

Javascript date and time, Indian date format, todays date

date format d-m-Y H:i:s


​var date = new Date();

var d = date.getDate();

var m = date.getMonth() + 1;

var y = date.getFullYear();

var H= date.getHours();

var i= date.getMinutes();

var s= date.getSeconds();

var mydate=d+'-'+m+'-'+y+' '+H+':'+i+':'+s;




add background image with javascript


<div id="tab1" style="position:relative; background-image:url(buttons/off.png);
    <a href="javascript:ChangeBackgroundImageOfTab('tab1', 'on');">
        <img id="DivBtn1" name="DivBtn1" src="buttons/text.png" >
    </a>
</div>
<script type="text/javascript">
function ChangeBackgroungImageOfTab(tabName, imagePrefix)
{
    var urlString = 'url(buttons/' + imagePrefix + '.png)';
    document.getElementById(tabName).style.backgroundImage =  urlString;
}

</script>

How to set a buttons innerHTML as an image?


<button id="button">Notepad</button>

<script type="text/javascript">
$(document).ready(function() {
var btn = document.getElementById("button");

btn.style.backgroundImage = "url('/media/notepad.jpg')";

});
</script>


How to validate an email address in JavaScript

<form>
  <p>Enter an email address:</p>
  <input id='email'>
  <button type='submit' id='validate'>Validate!</button>
</form>
<h2 id='result'></h2>

<script type="text/javascript">
function validateEmail(email) {
const re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
  return re.test(email);
}

function validate() {
  const $result = $("#result");
  const email = $("#email").val();
  $result.text("");

  if (validateEmail(email)) {
    $result.text(email + " is valid :)");
    $result.css("color", "green");
  } else {
    $result.text(email + " is not valid :(");
    $result.css("color", "red");
  }
  return false;
}

$("#validate").on("click", validate);
</script>

How to generate a simple popup contact us using jQuery

<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
 <link rel="stylesheet" href="/resources/demos/style.css">
 <script src="https://code.jquery.com/jquery-1.12.4.js"></script>
 <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<div class="messagepop pop">
  <form method="post" id="new_message" action="/messages">
    <p><label for="email">Your email or name</label><input type="text" size="30" name="email" id="email" /></p>
    <p><label for="body">Message</label><textarea rows="6" name="body" id="body" cols="35"></textarea></p>
    <p><input type="submit" value="Send Message" name="commit" id="message_submit"/> or <a class="close" href="/">Cancel</a></p>
  </form>
</div>

<a href="/contact" id="contact">Contact Us</a>

<script type="text/javascript">
$(document).ready(function() {
    $("#contact").dialog();
});
</script>

include http://docs.jquery.com/UI/Dialog

Note:dont need any css if using jquery dialog

<style type="text/css">
a.selected {
  background-color:#1F75CC;  color:white;  z-index:100;
}

.messagepop {
  background-color:#FFFFFF;
  border:1px solid #999999;
  cursor:default;
  display:none;
  margin-top: 15px;
  position:absolute;
  text-align:left;
  width:394px;
  z-index:50;
  padding: 25px 25px 20px;
}

label {
  display: block;
  margin-bottom: 3px;
  padding-left: 15px;
  text-indent: -15px;
}

.messagepop p, .messagepop.div {
  border-bottom: 1px solid #EFEFEF;
  margin: 8px 0;
  padding-bottom: 8px;
}
</style>

How to use check all checkboxes using jQuery?


<script type="text/javascript">

$(document).ready(function() {
$('#checkedAll').click(function () {    
     $('input:checkbox').prop('checked', this.checked);    
 });
 });
</script>
<div class="checkall">
<table><tr><td>
<input type="checkbox" name="checkedAll" id="checkedAll" />&nbsp;Check All</td></tr>

<tr><td><input type="checkbox" name="checkAll" class="checkSingle" />&nbsp;Cat</td></tr>

<tr><td><input type="checkbox" name="checkAll" class="checkSingle" />&nbsp;Dog/td></tr>

<tr><td><input type="checkbox" name="checkAll" class="checkSingle" />&nbsp;Cow</td></tr>
</table></div>

How to select all checkboxes using jQuery?

<form>
  <table>
    <tr>
      <td><input type="checkbox" id="select_all" /></td>
    </tr>
    <tr>
      <td><input type="checkbox" name="select[]" /></td>
    </tr>
    <tr>
      <td><input type="checkbox" name="select[]" /></td>
    </tr>
    <tr>
      <td><input type="checkbox" name="select[]" /></td>
    </tr>
  </table>
</form>
<script type="text/javascript">

$(document).ready(function() {
$('#select_all').change(function() {
  var checkboxes = $(this).closest('form').find(':checkbox');
  checkboxes.prop('checked', $(this).is(':checked'));
});
});
</script>



jquery contact us popup
how to validate email with jquery



Sunday, May 24, 2020

Wordpress Pdf Annotation Plugin | PHP API for annotation.js | API for Insert,Update and Delete annotation

I have search for annotation plugin in Wordpress plugin center but not able to found a good one so i developed a annotation plugin with the help of http://annotatorjs.org/
This plugin will provided you full control over data as it save it in your wordpress database itself.
With the plugin 
Plugin for annotation
Viewer page template for viewing all pages in pdf file with scroll
Manage annotation page for edit the text used for annotation and for deleting the annotation

<?php 
    /*
    Plugin Name: G-annotator
    Plugin URI: http://php-you.blogspot.com
    Description: Plugin for inline annotation in post
    Author:GRS
    Version: 1.0
    Author URI:http://php-you.blogspot.com
    */


  add_action('init','gannotator_init');
  add_action('wp','gannotator_wp');
  function gannotator_init()
  {
  if(is_user_logged_in() )
 
     add_action('parse_request', 'custom_requests');
 
  }
  
  }
   function gannotator_wp()
  {
  if(is_user_logged_in())
  {
    add_action('wp_enqueue_scripts', 'g_annatator_enqueue_script');
 
  
 
  }
  
  }
  
  function g_annatator_enqueue_script() { 
    wp_enqueue_style( 'annatator_css', plugins_url( 'js/annotator.min.css', __FILE__ ) );  
    wp_enqueue_script( 'annatator_script', plugin_dir_url( __FILE__ ) . 'js/annotator-full.min.js', array('jquery'), '', true );
    wp_enqueue_script( 'g_annatator_script', plugin_dir_url( __FILE__ ) . 'js/g-annotator.js', array('jquery'), '', true );
}

function custom_requests ( $wp ) { 

global $current_user; 


  $valid_actions = array('api', 'action2');
  
  if(
    !empty($wp->query_vars['myroute']) &&
    in_array($wp->query_vars['myroute'], $valid_actions) 
  ) {
  
     
  /***************Insert and Update annotation************************/ 
  $method = $_SERVER['REQUEST_METHOD'];
if ('PUT' === $method || 'POST' === $method ) {
   $jsondata=file_get_contents('php://input');
    
    $jsondecode=json_decode($jsondata);
    
    if($jsondecode->id=='')
    {
   
               $order   = array("\r\n", "\n", "\r");
                  $replace = '<br/>';
                $jsondecode->text=str_replace($order, $replace,$jsondecode->text);
               
        $my_cptpost_args = array(

         'post_title'    => $jsondecode->quote,

         'post_content'  => $jsondecode->text,

          'post_status'   => 'private',

         'post_type' => 'document_tags'

       );
       
                

      // insert the post into the database

     $cpt_id = wp_insert_post( $my_cptpost_args, $wp_error);

    add_post_meta($cpt_id, 'uri', $jsondecode->uri);
    add_post_meta($cpt_id, 'ranges', json_encode($jsondecode->ranges));
    add_post_meta($cpt_id, 'rawdata', json_encode($jsondecode));
    $jsondecode->id=$cpt_id;

    }
    else
    {
    $my_post = array(
      'ID'           => $jsondecode->id,
      'post_title'   => $jsondecode->quote,
      'post_content' => $jsondecode->text,
  );
                 $order   = array("\r\n", "\n", "\r");
                  $replace = '<br/>';
                $jsondecode->text=str_replace($order, $replace,$jsondecode->text);
 
// Update the post into the database
  wp_update_post( $my_post );
  update_post_meta( $jsondecode->id, 'ranges', json_encode($jsondecode->ranges));  
  update_post_meta( $jsondecode->id, 'rawdata', json_encode($jsondecode));  
    }
    
    
     $order   = array("<br/>");
   $replace = "\n";
   $jsondecode->text=str_replace($order, $replace,$jsondecode->text);
    echo json_encode($jsondecode);
       
    die(0);
}
 /***************Insert and Update annotation************************/ 
  /***************Delete annotation************************/ 
if ('DELETE' === $method)
{
$jsondata=file_get_contents('php://input');
    
 $jsondecode=json_decode($jsondata);
    
    if($jsondecode->id!=='')
    {
      wp_delete_post($jsondecode->id);
       //wp_trash_post($jsondecode->id);
      
    }
}
 
  /***************Delete annotation************************/   
  /************ listing annotation as per uri **********************/ 
  $current_url = $_GET['uri'];
  if($current_url!=='')
  {
    $mydata=array();
    $masterdata=array();
    $posts = get_posts(array(
'post_type' => 'document_tags',
'meta_key' => 'uri',
'meta_value' => $current_url,
 'post_status' => 'private',
 'author'        =>  $current_user->ID,
  ));

  
  foreach($posts as $pdata)
  {
  $order   = array("<br/>");
   $replace = '\n';
    $rawdata=str_replace($order, $replace,get_post_meta($pdata->ID, 'rawdata',false));
    $dat_ass_arr=json_decode($rawdata[0],true);
    $dat_ass_arr['id']=$pdata->ID;
  
   array_push($mydata,$dat_ass_arr);
  
  }
  
  $masterdata['total']=count($mydata);
   $masterdata['rows']= $mydata;
  
  echo json_encode($masterdata);
 
    
  }
 /************ listing annotation as per uri **********************/

exit();
    // do something here

  }//checking gannotation/api && myroute is api

}//close function

add_filter( 'rewrite_rules_array','my_insert_rewrite_rules' );
add_filter( 'query_vars','my_insert_query_vars' );
add_action( 'wp_loaded','my_flush_rules' );

// flush_rules() if our rules are not yet included
function my_flush_rules(){
    $rules = get_option( 'rewrite_rules' );

    if ( ! isset( $rules['gannotation/(.*?)/(.+?)'] ) ) {
        global $wp_rewrite;
        $wp_rewrite->flush_rules();
    }
}

// Adding a new rule
function my_insert_rewrite_rules( $rules )
{
    $newrules = array();
    $newrules['gannotation/(.*?)/(.+?)'] = 'index.php?myroute=$matches[1]&myargument=$matches[2]';
       return $newrules + $rules;
}

// Adding the id var so that WP recognizes it
function my_insert_query_vars( $vars )
{
     array_push($vars, 'myroute', 'myargument');
     return $vars;
}
add_action('init', function() {

     add_rewrite_rule(
        'gannotation/(.*?)/(.+?)/?',
        'index.php?myroute=$matches[1]&myargument=$matches[2]',
        'top'
    );

});




?>




Tuesday, December 1, 2015

Redirection problem while taking any site (solution works for me)

I have a problem with redirection,while taking any site fron my android phone browser or chrome browser on my pc a popup jumps up and asked to download an app or something.I am very much irritated with this problem and finally found a way to get rid of this problem

I am sharing the solution that works for me,please comment if its work for you.


Step-1

The problem is mainly from the modem,you need to type an address to get the setting of the modem from your browser.
Generally it will be 
http://192.168.1.1
may be you all have set with the default user name and password.
username:admin
password:admin


Step-2

In the setting there will be option to set the DNS or menu name like DNS SETUP,if you find you will able to see some numbers like 8.8.8.8,80.126.84.32 like that you need to clear it and set it to automatic mode and save(apply setting).

Step-3
This problem may come again,if you not changed you default user & password,so got to chage password option of you modem setting and change the password at once.


Step-4
Restart you modem and clear you browsing data and cookies from your browser and enjoy a problem free browsing.

I think this helps you.................




Wednesday, September 16, 2015

PHP Date and Time Format Validation (DD/MM/YYYY)(HH:MM)

function checkmydate($mydate)
{
$arr_date=explode("/",$mydate);
$day=$arr_date[0];
$month=$arr_date[1];
$year=$arr_date[2];
if(checkdate($month,$day,$year))
{
return true;
}
else
{
return false;
}
}
function checkmytime($mytime)
{
$arr_time=explode(":",$mytime);
if(count($arr_time)>0)
{
$hh_time=$arr_time[0];
$mm_time=$arr_time[1];

if(intval($hh_time)<24 && intval($mm_time)<60)
{
return true;
}
else
{
return false;
}
}
else
{
return false;
}
}

Thursday, August 6, 2015

input type number remove arrow (spinner) using css

 input[type=number]{ -moz-appearance: textfield; }
  input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
-webkit-appearance: none;
margin: 0;
}

You are able to specify for particular field using class

Format
input[type=number].classname{}

Monday, August 3, 2015

From Date and To date Validation Jquery date picker


$(function () {
    $("#txtFrom").datepicker({
        numberOfMonths: 2,
        onSelect: function (selected) {
            var dt = new Date(selected);
            dt.setDate(dt.getDate() + 1);
            $("#txtTo").datepicker("option", "minDate", dt);
        }
    });
    $("#txtTo").datepicker({
        numberOfMonths: 2,
        onSelect: function (selected) {
            var dt = new Date(selected);
            dt.setDate(dt.getDate() - 1);
            $("#txtFrom").datepicker("option", "maxDate", dt);
        }
    });
});

if you are using dd-mm-yy format use this code

                         sd=txt.split("-");
actdate=sd[1]+"/"+sd[0]+"/"+sd[2];
var dt = new Date(actdate);
           dt.setDate(dt.getDate() +5);
          var mydate=dt.getDate()+'-'+(dt.getMonth()+1)+'-'+dt.getFullYear();

Thursday, February 12, 2015

slideToggle slides down up and down again

On clicking button the div open then close by itself.

I faced similar problem,my error comes due to repeatation of code in other part of page.I think this may help you too solve problem

Sunday, January 26, 2014

Simple Regular Expression PHP

<?php
$subject = "abcDef123aa456";
$pattern = '/[0-9]+/';
preg_match_all($pattern, $subject,$matches);
print_r($matches);
?>
you will get the exact pattern..
Result:
Array ( [0] => Array ( [0] => 123 [1] => 456 ) )

<?php
$subject = "abcDef123aa456";
$pattern = '/[0-9]*/';
preg_match_all($pattern, $subject,$matches);
print_r($matches);
?>
you will be able to find at which position the numeric starts...
Result:
Array ( [0] => Array ( [0] => [1] => [2] => [3] => [4] => [5] => [6] => 123 [7] => [8] => [9] => 456 [10] => ) )    

Wednesday, December 18, 2013

WP Hit Counter Wordpress Plugin:-Function which helps you to show counter anywhere in template file

WP Hit Counter

Function which helps you to show counter anywhere in template file
paste the funtion any where and show this counter anywhere.
<?php echo HitCounter::display();?>

You will be able to create a shortcode with this function
  • Navigate to your plugins folder > wordpress-hit-counter
  • Open image.php and add the following function right before the ?> close: 
  •      add_shortcode( 'WP-Hit-Counter',HitCounter::display());

      Save your file

    Friday, August 30, 2013

    User-Access-Manager wordpress plugin sort field at user.php in admin

    Whe we use this plugin if we have many user registered in site and feel dificult to find the new user who are not a member yet,if you add the code below you will be able to see the "unauthorised users' by clicking at the "uam user groups"
    Added the following code below the file "user-access-manager.php" in your plugin folder.

    function user_sortable_columns( $columns) {

        $columns['uam_access'] =array( 'uam_access', 'desc' );
        return $columns;
    }
    add_filter( 'manage_users_sortable_columns', 'user_sortable_columns' );

    function user_column_orderby( $vars ) {
        if ( isset( $vars['orderby'] ) && 'uam_access' == $vars['orderby'] ) {

            $vars = array_merge( $vars, array(
                'meta_key' => 'uam_access',
                'orderby' => 'meta_value'

                   ) );


        }
        return $vars;
    }
    add_filter( 'request', 'user_column_orderby' );

    add_action('pre_user_query', 'status_order_in_user_query');

    function status_order_in_user_query($query){

    // print_r($query); // for debugging

    if('uam_access'==$query->query_vars['orderby'] && 'DESC'==$query->query_vars['order']) {

       $query->query_where .= " and id NOT IN (SELECT object_id FROM wp_uam_accessgroup_to_object
    WHERE object_type = 'user')";

    }

    }

    Tuesday, June 25, 2013

    Simple PHP Pagination

    Download this file
    https://docs.google.com/file/d/0B-WSEGv0VCtJYXRRQkRIVlFpNEE/edit?usp=sharing

    Make this as pagination.php and include to your php file

     <?php include("pagination.php");
                echo pagination(20, $page, 'mypage.php?page=', $count);
    ?>
    In mypage.php you should use the sql query according to pagination
    <?php
    $query="select * from table "
    if (isset($_GET['page'])) {
            $start = ($_GET['page'] - 1) * 20;
           $query.=" limit $start,20";
         

        } else {
    $query.=" limit 20";
         
        }
    $result=mysql_fetch_array(mysql_query($query));
    ?>

    Download any file with php using header

    You can download any file using this
    Step1:Copy the code to a page called download.php(note:dont need any html tags should only contains this code)
    Step2:Create a link with your file name
    <a href="download.php?filename=myfile.jpg">Download</a> in your page(not at download page)


    <?php
     //BUILD THE FILE INFORMATION
         $file = $_REQUEST['filename'];

         //CREATE/OUTPUT THE HEADER
         header("Content-type: application/force-download");
         header("Content-Transfer-Encoding: Binary");
         header("Content-length: ".filesize($file));
         header("Content-disposition: attachment; filename=\"".basename($file)."\"");
         readfile($file);
    ?>