xaero
User-
Posts
98 -
Joined
-
Last visited
xaero's Achievements
Explorer (1/14)
0
Reputation
-
появление блока, когда в text форму введен текст
xaero replied to ilgibitym's question in JavaScript
http://jsfiddle.net/U8Z2n/3/ -
Привет всем ———————-- id | name | prev_id ———————-- 1 | absc | 2 ———————-- 2 | dbcs | 3 ———————-- 3 | cols | 4 ———————-- 4 | noth | 0 prev_id - id предыдущий строки Можно ли select делать такой запрос который подключает как колонка предыдущий строки ?
-
У меня имеется 2 таблиц 1. search_result 2. products хотелось бы подсчитать сколько строк находится в таблице products который у таблиц указано поля search_result.query_text SELECT s.id, s.query_text ( select count(*) from products where name concat('%', s.query_text, '%') limit 0, 1 ) as total FROM search_result AS s GROUP BY s.query_text вообще то такое возможно?
-
Как выровнять текстовые блоки Как можно делать блоки ровным. От зависимости текста. Одного блока больше текст и остальные высота боки чтобы были ровным. http://my.jetscreenshot.com/1668/20100216-vozf-44kb.jpg
-
Лучше изучайте ExtJS
-
$text = ' hallow world "nothing i fill" current "asdasd"'; нужно удалить пробелы вне кавычки ....
-
Посмотрите ... <html> <head> <title> Calendar </title> </head> <style> /* CALENDAR */ table.cal { border-collapse: collapse; border: 1px solid #eaeaea; } table.cal td { text-align: center; } td.center { font-weight: bold; color: #216792; } td.prev { width: 25px; text-align: center; } td.prev a { font-wegith: bold; } td.center { text-align: center; width: 100%; } td.next { width: 25px; text-align: center; } td.next a { font-wegith: bold; } table.cal td { padding: 3px; } /* current date */ table.cal td.cdt { background: #f0f4fe; font-weight: bold; } /* current date is sunday */ table.cal td.scd { background: #E83903; color: #fff; } /* default days */ table.cal td.def { color: #5b6376; } /* sunday days */ table.cal td.sbg { color: #dc143c; background: #f7f7f7; } /* week defaults */ table.cal tr.week td { width: 20px; text-align: center; } /* week default sunday day */ table.cal td.wsd { background: #000064; color: #ffffff;} /* week default days */ table.cal td.wdd { background: #e0eaff; color: 4974d5; } /* week selected day */ table.cal td.wsl { background: #e0eaff; color: #000064;} table.cal td.wss { background: #ffa500; color: #ffffff;} </style> <body> <?php class Calendar { var $year; var $month; var $date; var $leap; var $lang; var $path; var $dates; function Calendar($l) { $this->year = date('Y'); $this->month = date('n'); $this->date = date('j'); $this->leap = date('L'); $this->lang = $l; $this->month_names = array( 'uz'=>array(1=>'Yanvar', 'Fevral', 'Mart', 'Aprel', 'May', 'Iyun', 'Iyul', 'August', 'Sentyabr', 'Oktyabr', 'Noyabr', 'Dekabr'), 'ru'=>array(1=>'Январь', 'Февраль', 'Март', 'Апрель', 'Май', 'Июнь', 'Июль', 'Август', 'Сентябрь', 'Октябрь', 'Ноябрь', 'Декабрь'), 'en'=>array(1=>'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'Septempber', 'Oktober', 'November', 'December') ); $this->week_names = array( 'uz'=>array('Du', 'Se', 'Ch', 'Pa', 'Ju', 'Sh', 'Ya'), 'ru'=>array('Пн', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб', 'Вс'), 'en'=>array('Su', 'Mo', 'Tu', 'We', 'Tr', 'Fr', 'St') ); $this->dates = array(); } function Days(){ if($this->month==3 or $this->month==6 or $this->month==9 or $this->month==11){ return 30; }else if($this->month==2){ if($this->leap){ return 29; }else{ return 28; } }else{ return 31; } } function First(){ $first_day = date('w', mktime(0, 0, 0, $this->month, 1, $this->year)); if($this->lang=='uz' or $this->lang=='ru'){ $first_day = ($first_day==0) ? 6 : $first_day - 1; } return $first_day; } function Week(){ return date('w', mktime(0, 0, 0, $this->month, date('d'), $this->year)); } function Body() { $count_days = 0; $space_days = 0; $tbl = "<table cellspacing=0 cellpadding=0 border=0 class='cal'>"; $tbl.= "<tr>"; $tbl.= "<td colspan=7 align=center>"; $tbl.= "<table cellspacing=0 cellpadding=0 border=0 style='border-collapse:collapse'>"; $tbl.= "<tr>"; if(($this->month-1)==0){ $tbl.= "<td class='prev'><a href='".$this->path."y=".($this->year-1)."&m=12&d=".$this->date."'>«</a></td>"; }else{ $tbl.= "<td class='prev'><a href='".$this->path."y={$this->year}&m=".($this->month-1)."&d=".$this->date."&a=p'>«</a></td>"; } $tbl.= "<td class='center'>".$this->month_names[$this->lang][$this->month]." ".$this->year."</td>"; if(($this->month+1)==13){ $tbl.= "<td class='next'><a href='".$this->path."y=".($this->year+1)."&m=1&d=".$this->date."&a=n'>»</a></td>"; }else{ $tbl.= "<td class='next'><a href='".$this->path."y={$this->year}&m=".($this->month+1)."&d=".$this->date."'>»</a></td>"; } $tbl.= "</tr>"; $tbl.= "</table>"; $tbl.= "</td>"; $tbl.= "</tr>"; $tbl.= "<tr class='week'>"; for($col=0; $col<7; $col++){ $w = $this->Week(); $val = $this->week_names[$this->lang][$col]; if($this->lang=='uz' or $this->lang=='ru'){ if($w==0 && $col==6){ $tbl.= "<td class='wss'>{$val}</td>"; }else{ if($col==($w-1)){ $tbl.= "<td class='wsl'>{$val}</td>"; }else{ $cls = ($col==6) ? 'wsd' : 'wdd'; $tbl.= "<td class='$cls'>{$val}</td>"; } } }else{ if($col==$w){ $cls = ($col==0) ? 'wss' : 'wsl'; $tbl.= "<td class='{$cls}'>{$val}</td>"; }else{ $cls = ($col==0) ? 'wsd' : 'wdd'; $tbl.= "<td class='{$cls}'>{$val}</td>"; } } } $tbl.= "</tr>"; for($row=0; $row<6; $row++){ $tbl.= "<tr>"; for($col=0; $col<7; $col++){ if($space_days<$this->First()){ $tbl.= "<td> </td>"; }else{ $count_days++; if($count_days<=$this->Days()){ $en = ($this->lang=='en') ? 0 : 6; if($count_days==date('d')){ $cls = ($en==$col) ? 'scd' : 'cdt'; $tbl.= "<td class='{$cls}'>"; if($this->getDates($count_days)){ $m = $this->month; $d = $count_days; $tbl.= "<a href='".$this->path."y={$this->year}&m={$m}&d={$d}'><b>{$count_days}</b></a>"; }else{ $tbl.= $count_days; } $tbl.= "</td>"; }else{ $cls = ($en==$col) ? 'sbg' : 'def'; $tbl.= "<td class='{$cls}'>"; if($this->getDates($count_days)){ $m = $this->month; $d = $count_days; $tbl.= "<a href='".$this->path."y={$this->year}&m={$m}&d={$d}'><b>{$count_days}</b></a>"; }else{ $tbl.= $count_days; } $tbl.= "</td>"; } }else{ $tbl.= "<td> </td>"; } } $space_days++; } $tbl.= "</tr>"; } $tbl.= "</table>"; return $tbl; } function setAction() { if(!empty($_GET['y']) && !empty($_GET['m']) && !empty($_GET['d'])) { $y = (int) $_GET['y']; $m = (int) $_GET['m']; $d = (int) $_GET['d']; if(is_numeric($y) && is_numeric($m) && is_numeric($d)){ if($y>=2000 && $y<=2050){ $this->year = $y; } if($m<=12){ $this->month = $m; } if($d<=$this->Days()){ $this->date = $d; } } } } function getDates($d) { $result = 0; if(is_array($this->dates) && count($this->dates)>0){ foreach($this->dates as $k=>$v){ if(!preg_match("/^([0-9]{4})\-([0-9]{2})\-([0-9]{2})$/i", $v)){ die("Incorrect date: {$v}"); }else{ $m = ($this->month<10) ? '0'.$this->month : $this->month; $c = ($d<10) ? '0'.$d : $d; $y = $this->year; $l = trim($y.'-'.$m.'-'.$c); if(strcmp($v, $l)==0){ $result = 1; } } } } return $result; } } $cal = new Calendar('ru'); // ru | en $cal->setAction(); $cal->path = 'calendar.php?'; $cal->dates = array('2009-08-21'); print $cal->Body(); ?> </body> </html>
-
Кто нибудь установил MCFileManager или MCImagerManager я попробуя у меня вообще не получаестя ... ? Fatal error: Trying to get out of defined root path. Root: Z:/home/192.168.1.4/www/editor/jscripts/tiny_mce/plugins/imagemanager/images, Path: Z:/home/192.168.1.4/www/editor/imagemanager/images in Z:\home\192.168.1.4\www\editor\jscripts\tiny_mce\plugins\imagemanager\classes\FileSystems\FileFactory.php on line 91 даёт такая ошибка
-
SELECT cm_message from `chat_messages` order by `cm_id` desc limit 10
-
Нашёл всё как это делать. Индексировать надо ...
-
Привет всем!!! у меня есть триггер который удаляет из двух таблиц: DELIMITER # CREATE TRIGGER `otz_delete` BEFORE DELETE ON orders_status_otzvon FOR EACH ROW BEGIN /* delete from crm_telephony */ DELETE FROM crm_telephony WHERE id_zv=OLD.id_zv AND type='otzvon'; /* delete from crm_log */ DELETE FROM crm_log WHERE log_id=OLD.id_zv AND process=28; END;# Результат можно посмотреть здесь (это у меня локалке так работает 26 сек) : http://www.jetScreenshot.com/demo/20090608-78y-29kb.jpg
-
У меня есть такой sql код: select sites.*, cats.cat_id as cat_id, scats.name as cat_name, aff.affiliate_firstname as affiliate_firstname, aff.affiliate_email_address as aff_mail, afs.view as view, afs.in_cart as in_cart, afs.orders as orders, afs.customers as customers, afs.date as date, afs.uniq_hosts_liv as uniq_hosts_liv, afs.uniq_hosts_ramb as uniq_hosts_ramb, afs.pages_liv as pages_liv, afs.pages_ramb as pages_ramb, afs.tic as tic, afs.pr as pr from affiliate_sites as sites left join affiliate_sites_to_category as cats on(sites.id=cats.affiliate_site) left join affiliate_sites_category as scats on(cats.cat_id=scats.id) left join affiliate_affiliate as aff on(sites.affiliate_id=aff.affiliate_id) left join affiliate_statistics as afs on(sites.id=afs.affiliate_site) left join affiliate_statistics as afs on(sites.id=afs.affiliate_site) в этой таблице очень много записав мне нужно только один запись примерно так: ORDER afs.date DESC LIMIT 0,1
-
Здравствуйте ... для не которых таблицы я сделал тригерры. Тригеррые запустил в MySQL front и MySQL HeidiSQL там работает все классно вот триггеры: DELIMITER $$ DROP TRIGGER IF EXISTS `cdr_update`$$ CREATE TRIGGER `cdr_update` AFTER UPDATE ON cdr FOR EACH ROW BEGIN /* update crm_telephony */ UPDATE crm_telephony SET id_zv = NEW.id_cd, orders_id = NEW.orders_id, man_id = NEW.man_id, type_zv = NEW.type_zv, telephone = NEW.telephone, date_start = NEW.calldate, duration = NEW.billsec, status = NEW.disposition, record = NEW.userfield, comment = NEW.comment, dest = NEW.dst WHERE id_zv=OLD.id_cd AND type='cdr'; /* update crm_log */ UPDATE crm_log SET log_id = NEW.id_cd, man_id = NEW.man_id, date_start = NEW.calldate, date_finish = DATE_ADD(NEW.calldate, INTERVAL NEW.duration SECOND), telephone = NEW.telephone, dest = NEW.dst, type = 29, type_zv = NEW.type_zv, action = 'view', comment = NEW.comment, process = 29, orders_id = NEW.orders_id WHERE log_id=OLD.id_cd AND process=29; END;$$ /* insert cdr table trigger */ DELIMITER $$ DROP TRIGGER IF EXISTS `cdr_insert`$$ CREATE TRIGGER `cdr_insert` AFTER INSERT ON cdr FOR EACH ROW BEGIN /* insert crm_telephony */ INSERT INTO crm_telephony SET id_zv = NEW.id_cd, orders_id = NEW.orders_id, man_id = NEW.man_id, type_zv = NEW.type_zv, type = 'cdr', telephone = NEW.telephone, date_start = NEW.calldate, duration = NEW.billsec, status = NEW.disposition, record = NEW.userfield, comment = NEW.comment, dest = NEW.dst; /* insert crm_log */ INSERT INTO crm_log SET log_id = NEW.id_cd, man_id = NEW.man_id, date_start = NEW.calldate, date_finish = DATE_ADD(NEW.calldate, INTERVAL NEW.duration SECOND), telephone = NEW.telephone, dest = NEW.dst, type = 29, type_zv = NEW.type_zv, action = 'view', comment = NEW.comment, process = 29, orders_id = NEW.orders_id; END;$$ но когда запускаю в phpMyAdmin даёт ошибка ...? можно ли в phpmyadmin запускать не сколько триггеров сразу ... ? спасибо за ответы ...