function softtrunc($str, $len) { $str = strrevprepare($str); if (strlen($str)>=$len) { $pos = strpos($str, " ", $len); $str = substr($str, 0, $pos)."..."; } $str = strprepare($str); return $str; }
function getStreetIDByISCZVSTREET($ZVSTREET, $district) { $sql_ag="SELECT `ID` FROM `streets` WHERE `IscStreet`='".strprepare($ZVSTREET)."' AND `IscDistrict`='".$district."' ; "; $row=$this->db->query_first($sql_ag); // ajax_echo_r($row); if ($row->ID) { // if found then return it $ret = $row->ID; } else { $ret = 1; // else return default value } return $ret; }