This file contains 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
import $ from "jquery"; | |
/** | |
* Left Menu - Active Dynamically | |
*/ | |
let current_route = $('#current_route').val(); | |
let active = {'font-weight': 'bold'}; | |
//console.log(current_route); | |
/** |
This file contains 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 | |
// check for valid email address | |
$email = $_POST['remail']; | |
$pattern = '/^[^@]+@[^srn'";,@%]+$/'; | |
if (!preg_match($pattern, trim($email))) { | |
$error[] = 'Please enter a valid email address'; | |
} |
This file contains 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 | |
private function validateDate($date, $format = 'd-m-Y') | |
{ | |
$d = \DateTime::createFromFormat($format, $date); | |
return $d && $d->format($format) == $date; | |
} | |
if ($this->validateDate($dueDate) == true) { | |
$todo->setDueDate(\DateTime::createFromFormat('d-m-Y', $dueDate)); | |
} |
This file contains 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 | |
// Snippet for Symfony 2 application that uses Doctrine 2 to handle transactions | |
// It uses the names of the objects/doctrine repositories from the Beta 4 Manual of Symfony 2. | |
// Get the entity manager | |
$em = $this->getDoctrine()->getEntityManager(); | |
// suspend auto-commit | |
$em->getConnection()->beginTransaction(); |
This file contains 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
$sorular = $em->createQueryBuilder() | |
->select('s') | |
->from('PauSemYonetimBundle:Sorular', 's') | |
->where('s.testler = :test') | |
->setParameter('test',$test) | |
->getQuery() | |
->getResult(); | |
//sorularin dizideki sıralamasını değiştir |
This file contains 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
package com.animacoder.akcaykentportali; | |
import android.app.Activity; | |
import android.content.Context; | |
import android.content.Intent; | |
import android.net.ConnectivityManager; | |
import android.net.NetworkInfo; | |
import android.os.Bundle; | |
import android.view.Menu; | |
import android.widget.Toast; |
This file contains 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
$file = $_FILES['fileinput']; | |
$this->SF2imageUpload($file['name'],$file['type'],$file['size'],$file['error'],$file['tmp_name'],$upload_directory); | |
public function SF2imageUpload($file, $file_type, $file_size, $file_error, $temp, $upload_url) | |
{ | |
//Kabul edilen uzantılar. | |
$allowed_extensions = array("gif", "jpeg", "jpg", "png"); |