Posts

php - Pull row data into modal window -

i have mysql query within php function: $sql_json = "select * mytable"; i displaying returned data table grid. first row has edit button once user clicks on it, opens modal window. should transfer data row bootstrap modal window. echo "<tr><td> <a class=\"btn btn-primary btn-mini\" data-toggle=\"modal\" href=\"#myeditmodal\" data-project-id=\"" .$row['pk_tid']. "\" \">delete/edit</a></td>"; now trying $row['pk_tid'] modal window here: <div class="modal hide fade" id="myeditmodal" tabindex="-1" role="dialog" aria-labelleby="mymodallabel" aria-hidden="true"> <div class="modal-header"> <div class="modal-body"> <form class="well-small" action="edit.php" method="post" id="modalform" name="modalform">...

bash - Replace 5 dots with a single space -

i have title has 5 consecutive dots i'd replaced 1 space using bash script. doing not helping: tr '.....' ' ' obviously because it's replacing 5 dots 5 spaces. basically, have title want changed slug. i'm using: tr a-z a-z | tr '[:punct:] [:blank:]' '-' to change lowercase , change punctuation mark , spaces hyphen, i'm stuck dots. the title i'm using like: believe.....right now so want turned believe-right-now how change 5 dots single space? you don't need sed or awk. original tr command should trick, need add -s flag. after tr translates desired characters hyphens, -s squeeze repeated hyphens one: tr a-z a-z | tr -s '[:punct:] [:blank:]' '-' i'm not sure input/output context you, tested above follows, , worked me: tr a-z a-z <<< "believe.....right now" | tr -s '[:punct:] [:blank:]' '-' output: believe-right-now see http://www.ss64...

Can I exclude HTML output when there's no result in mysql database when querying via PHP -

in short, have php output (the code part) needs hyperlinked when displayed on webpage, issue is, when there's no result, hyperlinks blank url. there anyway not display html if there's no result when search executed? to clarify, i'd need apply more 1 section of output. here's specific part of code. if(isset($_post['search'])) { $searchq = $_post ['search']; $query = mysql_query ("select * hh_list2 company '%$searchq%'") or die ("could not search"); //ot here !!!!! $count = mysql_num_rows($query); if ($count == 0) { $output = 'sorry did not find anything'; }else{ while($row = mysql_fetch_array($query)) { $company = $row ['company']; $twitter_id = $row ['twitter_id']; $online_chat = $row ['online_chat']; $online_form = $row ['online_form']; $email_1 = $row ['email_1']; $email_2 = $row ...

osx - Boot Camp, howto manually change the configuration -

so visiting in-laws week, , mother in law has imac osx 10.5. had small windows 7 partition dual booting boot camp. turns out, uses windows partition, , partition way small. asked me make bigger. so, used gparted , made partition right sizes; however, mac boot manager not recognize windows partition now. expected happen, did not expect boot camp useless afterwards. "untitled" windows partition in osx looks ok. boot camp ui lets gives me option restore single partition. my question is: can manually change boot entries without ui ala grub? or, how else can fix boot loader? i never found config file ala gurb fix issue, did fix it. there a few things @ play here. looks closed of tabs reading off of, take stab @ writing found. the osx boot loader @ (from memory) hybrid of mbr , gpt. if not synced, not show option. gparted not sync them automatically use "gptsync" sync mbr of disk gpt of partitions this allow osx bootloader show windows ...

css - How can I center my logo for my mobile site? -

i’m trying horizontally center logo on mobile version of site. can’t center, though. i’ve tried various things nothing seems move it. my code is: @media screen , (max-width: 640px) { .logo-image .logo img { max-height: 70px; margin-top: -15px; margin-bottom: 15px; width: auto; background: center; } } for h1.logo try text-align:center;

javascript - How to have a default option in Angular.js select box -

i have searched google , can't find on this. i have code. <select ng-model="somethinghere" ng-options="option.value option.name option in options" ></select> with data options = [{ name: 'something cool', value: 'something-cool-value' }, { name: 'something else', value: 'something-else-value' }]; and output this. <select ng-model="somethinghere" ng-options="option.value option.name option in options" class="ng-pristine ng-valid"> <option value="?" selected="selected"></option> <option value="0">something cool</option> <option value="1">something else</option> </select> how possible set first option in data default value result this. <select ng-model="somethinghere" ....> <option value="0" selected=...

Spring @Autowired Not Working Error Creating Bean Injection Of Autowire dependencies failed -

i use spring , have lot of trouble using @autowired annotation. upon compiling throws these errors edit using regular java classes write classes. not causing problem, it? aug 12, 2013 2:40:32 pm org.apache.catalina.core.applicationcontext log info: no spring webapplicationinitializer types detected on classpath aug 12, 2013 2:40:32 pm org.apache.catalina.core.applicationcontext log info: initializing spring root webapplicationcontext aug 12, 2013 2:40:33 pm org.apache.catalina.core.standardcontext listenerstart severe: exception sending context initialized event listener instance of class org.springframework.web.context.contextloaderlistener org.springframework.beans.factory.beancreationexception: error creating bean name 'homecontroller': injection of autowired dependencies failed; nested exception org.springframework.beans.factory.beancreationexception: not autowire field: com.mycompany.smsdatabase.service.personimport com.mycompany.smsdatabase.controller.homecontroll...