// Ascending order
Partner::model()->findAll(array('order' => 'company'));
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 sendPushNotification($to = '', $data = array()){ | |
$apiKey = ''; | |
$fields = ['to' => $to, 'notification' => $data]; | |
$headers = ['Authorization: key='.$apiKey, 'Content-Type: application/json']; | |
$url = 'https://fcm.googleapis.com/fcm.send'; | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_URL, $url); | |
curl_setopt($ch, CURLOPT_POST, true); | |
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); |
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
""" | |
Functions available are: | |
-------------------------------------------- | |
+ : addition | |
- : subtraction | |
* : multiplication | |
/ : division | |
% : percentage | |
""" | |
import sys |
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
jQuery(document).ready(function ($) { | |
$("#btnPurchase").click(function (event) { | |
event.preventDefault(); // stopping submitting | |
var formData = new FormData($('form')[0]); | |
var data = $("#Purchaseasset").serializeArray(); | |
var url = $("#Purchaseasset").attr('action'); | |
$.ajax({ | |
url: url, | |
type: 'post', | |
data: formData, |
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
INSERT INTO `AuthAssignment` (`itemname`, `userid`, `bizrule`, `data`) VALUES ('Admin', '1', NULL, 'N'); | |
INSERT INTO `AuthItem` (`name`, `type`, `description`, `bizrule`, `data`) VALUES ('Admin', 0, 'Admin', NULL, 'N;'); |
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
<style type="text/css">@import url("https://fonts.googleapis.com/css?family=Orbitron"); | |
.alarm-clock { | |
position: relative; | |
padding: 10px; | |
border-radius: 10px; | |
background-color: tan; | |
} | |
.alarm-clock .date { |
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
<style type="text/css"> | |
/* Google font */ | |
@import url('https://fonts.googleapis.com/css?family=Orbitron'); | |
#digit_clock_time { | |
font-family: 'Work Sans', sans-serif; | |
color: #66ff99; | |
font-size: 35px; | |
text-align: center; | |
padding-top: 20px; |
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
//$months = [1 => 'Final Sale', 2 => 'Quotation']; | |
$months = array(1 => 'Jan.', 2 => 'Feb.', 3 => 'Mar.', 4 => 'Apr.', 5 => 'May', 6 => 'Jun.', 7 => 'Jul.', 8 => 'Aug.', 9 => 'Sep.', 10 => 'Oct.', 11 => 'Nov.', 12 => 'Dec.'); | |
echo $form->dropDownList($model, 'month', $months, array('prompt' => 'Select')); | |
/* year for loop*/ | |
$year = array(); | |
for ($i=0; $i < 10; $i++){ | |
$y = 2020+$i; | |
$year[$y] = $y; |
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 generatePassword($length=9, $strength=0) { | |
$vowels = 'aeuy'; | |
$consonants = 'bdghjmnpqrstvz'; | |
if ($strength >= 1) { | |
$consonants .= 'BDGHJLMNPQRSTVWXZ'; | |
} | |
if ($strength >= 2) { | |
$vowels .= "AEUY"; | |
} | |
if ($strength >= 4) { |