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 | |
| /** | |
| * Clase para registrar usuarios en nuestra base de datos | |
| */ | |
| class ManageUsers | |
| { | |
| public $link; | |
| function __construct(){ | |
| $db_connection = new Database(); |
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 | |
| /** | |
| * Clase para conectarnos a la base de datos | |
| */ | |
| class Database | |
| { | |
| protected $db_conn; //objeto de conexión | |
| public $db_name = 'testconnection'; //nombre de la base de datos | |
| public $db_user = 'root'; //username de mysql | |
| public $db_pass = 'root'; //password de mysql |
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
| SET FOREIGN_KEY_CHECKS = 0; | |
| UPDATE `core_store` SET `store_id` = '0' WHERE `store_id` = 2 LIMIT 1 ; | |
| UPDATE `core_website` SET `website_id` = '0' WHERE `website_id` = 2 LIMIT 1 ; | |
| UPDATE `core_store_group` SET `group_id` = '0' WHERE `group_id` = 2 LIMIT 1 ; | |
| SET FOREIGN_KEY_CHECKS = 1; |
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 | |
| $afterElementHtml = '<p class="nm"><small>' . ' Nombre del archivo a generar.' . '</small></p>'; | |
| $linkFieldset->addField('field_name', 'text', array( | |
| 'after_element_html' => $afterElementHtml, | |
| )); |
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 | |
| /* | |
| A small frog wants to get to the other side of the road. The frog is currently located at position X and wants to get to a position greater than or equal to Y. The small frog always jumps a fixed distance, D. | |
| Count the minimal number of jumps that the small frog must perform to reach its target. | |
| Write a function: | |
| function solution($X, $Y, $D); | |
| that, given three integers X, Y and D, returns the minimal number of jumps from position X to a position equal to or greater than Y. | |
| For example, given: | |
| X = 10 | |
| Y = 85 |
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 | |
| /* | |
| A zero-indexed array A consisting of N different integers is given. The array contains integers in the range [1..(N + 1)], which means that exactly one element is missing. | |
| Your goal is to find that missing element. | |
| Write a function: | |
| function solution($A); | |
| that, given a zero-indexed array A, returns the value of the missing element. | |
| For example, given array A such that: | |
| A[0] = 2 | |
| A[1] = 3 |
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 | |
| /* | |
| A non-empty zero-indexed array A consisting of N integers is given. Array A represents numbers on a tape. | |
| Any integer P, such that 0 < P < N, splits this tape into two non-empty parts: A[0], A[1], ..., A[P − 1] and A[P], A[P + 1], ..., A[N − 1]. | |
| The difference between the two parts is the value of: |(A[0] + A[1] + ... + A[P − 1]) − (A[P] + A[P + 1] + ... + A[N − 1])| | |
| In other words, it is the absolute difference between the sum of the first part and the sum of the second part. | |
| For example, consider array A such that: | |
| A[0] = 3 | |
| A[1] = 1 | |
| A[2] = 2 |
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 | |
| //Remove Paypal with localdelivery | |
| function alter_shipping_methods($list){ | |
| $chosen_titles = array(); | |
| $available_methods = WC()->shipping->get_packages(); | |
| $chosen_rates = ( isset( WC()->session ) ) ? WC()->session->get( 'chosen_shipping_methods' ) : array(); | |
| foreach ($available_methods as $method) | |
| foreach ($chosen_rates as $chosen) { |
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 | |
| function random_password( $length = 8 ) { | |
| $chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()_-=+;:,.?"; | |
| $password = substr( str_shuffle( $chars ), 0, $length ); | |
| return $password; | |
| } | |
| $password = random_password(8); | |
| ?> |
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
| <!DOCTYPE> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <meta name="author" content="Adila Faruk"> | |
| <title>Exporting Data to a CSV File</title> |