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(isset($_POST['intro'])){ | |
$link = mysql_connect('localhost', 'root', 'admin') | |
or die('No se ha podido conectar al server'); | |
mysql_select_db('dwes') or die('No se ha encontrado la base de datos'); | |
$query = 'select * from usuarios'; | |
$result = mysql_query($query, $link); | |
$is = false; | |
while($lines = mysql_fetch_row($result)){ | |
if(($lines[0] == $_POST['user'] && $lines[1] == $_POST['pass'])){ |
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> | |
<html> | |
<head> | |
<title>Gestion de formularios 1</title> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width"> | |
<script src="js/jscript.js" type="text/javascript"></script> | |
</head> | |
<body> | |
<form name="form1" action="index.html"> |
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 | |
/** | |
* Created by PhpStorm. | |
* User: Juan | |
* Date: 10/7/2015 | |
* Time: 8:15 PM | |
*/ | |
class indexController extends customersController | |
{ |
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
public function getCustomers() | |
{ | |
$customers = $this->_db->query('select c.*, ctrl.seen, ctrl.date as edited from customers c, control ctrl where c.id = ctrl.customer_id and ctrl.user_id = ' . Session::get('id_user') . ' order by ctrl.date desc, c.date desc'); | |
return $customers->fetchAll(PDO::FETCH_ASSOC); | |
} |
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 | |
namespace Ourentec\CustomersBundle\Form; | |
use Symfony\Component\Form\AbstractType; | |
use Symfony\Component\Form\FormBuilderInterface; | |
use Symfony\Component\OptionsResolver\OptionsResolverInterface; | |
class CustomerType extends AbstractType | |
{ |
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
protected function getSql($key) | |
{ | |
if (isset($_POST[$key]) && !empty($_POST[$key])) { | |
$_POST[$key] = strip_tags($_POST[$key]); | |
if (!get_magic_quotes_gpc()) { | |
$mysqli = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME); | |
if ($mysqli->connect_error) { | |
die('Connection error (' . $mysqli->connect_errno . ') ' | |
. $mysqli->connect_error); |
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
public function save($data) | |
{ | |
$customer = new Customer(); | |
$customer->setName($data['name']); | |
if (isset($data['lastname'])) $customer->setLastname($data['lastname']); | |
$customer->setPhone($data['phone']); | |
if (isset($data['address'])) $customer->setAddress($data['address']); | |
if (isset($data['email'])) $customer->setEmail($data['email']); |
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
/** | |
* @param $msisdn | |
* @param $amount | |
* @param $token | |
* @return array | |
*/ | |
public function getBill($msisdn, $amount, $token) | |
{ | |
if($this->_billError500 == true) { | |
error_log(print_r('ha dado error 500', 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
// factory.js | |
.factory('Nombre', ['$resource', function ($resource) { | |
return $resource('http://url.api/api/login', {}, { | |
save: { | |
method: 'POST', | |
headers: {Authentication: 'tu_token_o_apikey'} | |
} | |
}); | |
}]); |
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 | |
foreach ($imgPaths as $img) { | |
echo '<img src="' . $img->attr["src"] . '"'/> | |
} |
OlderNewer