This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function daysCount($date) | |
| { | |
| $diff = (strtotime( date('Y-m-d') ) - strtotime($date)) / 86400; | |
| return $diff; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if( $sql_statement->execute() ) { | |
| $this->db_connect->lastInsertId(); | |
| if( $sql_statement->rowCount() > 0 ) { | |
| $this->previousid = $this->db_connect->lastInsertId('showdate'); | |
| var_dump($this->previousid); | |
| } else { | |
| // no record inserted, therefore error condition exists | |
| echo "No record inserted. Cannot proceed."; | |
| $error = TRUE; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| unset($_SESSION['session_var']); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Get list of existing TRIGGERs in MYSQL | |
| While MySQL has features like StoredProcedure and View, it doesn't have any option for displaying TRIGGER list in the 'Schemata' tab (right) section of QueryBrowser. | |
| Generally, we need a third party control like MySQL Workbench to get the list of existing TRIGGER lists.But there is another way through which we can get existing trigger lists and that is from the Metadata(Data about data). | |
| To get all the trigger list irrespective of the database name: | |
| SELECT * FROM information_schema.TRIGGERS; | |
| To get list of trigger against a specific database: | |
| SELECT * FROM information_schema.TRIGGERS WHERE TRIGGER_SCHEMA='database_name'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if(!$sql_statement->execute()) { | |
| return false; | |
| } | |
| $sql_count = $sql_statement->rowCount(); | |
| if($sql_count > 0) { | |
| return true; | |
| }else { | |
| return false; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if (!empty($_POST)) { | |
| if (!empty($_POST['save'])) { | |
| $active = isset($_POST['showcancelled']) && $_POST['showcancelled'] ? "1" : "0"; | |
| if ($active == 1) { | |
| echo "Checked"; | |
| } else { | |
| echo "fail"; | |
| } | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| class HelperFunctions | |
| { | |
| /** | |
| * This function is responsible to convert % to double | |
| * @param integer $a | |
| * @return double | |
| */ | |
| public static function isPercentage($a){ | |
| if(preg_match('/%/',$a)){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| class HelperFunctions | |
| { | |
| /** | |
| * This function is responsible to convert % to double | |
| * @param integer $a | |
| * @return double | |
| */ | |
| public static function isPercentage($a){ | |
| if(preg_match('/%/',$a)){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| //add_shortcode('wpbsearch', 'get_search_form'); | |
| function wpbsearchform( $form ) { | |
| $form = '<form role="search" method="get" id="searchform" action="' . home_url( '/' ) . '" > | |
| <div><label class="screen-reader-text" for="s">' . __('Search for:') . '</label> | |
| <input type="text" value="' . get_search_query() . '" name="s" id="s" /> | |
| <input type="submit" id="searchsubmit" value="'. esc_attr__('Search') .'" /> | |
| </div> | |
| </form>'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* Smartphones (portrait and landscape) -----------*/ | |
| @media only screen and (min-device-width : 320px) and (max-device-width : 480px) { | |
| /* Styles */ | |
| } | |
| /* Smartphones (landscape) -----------*/ | |
| @media only screen and (min-width : 321px) { | |
| /* Styles */ | |
| } |