{ RaiseError => 1, AutoCommit => 1 } );
$multi_maxpage = 0;
-$sql = "SELECT id, title, part, startpage, endpage, showpagediff
+$sql = "SELECT id, title, part, startpage, endpage, showpagediff, indexpage
FROM pdffile
WHERE title_id = '$title_group'
ORDER BY part DESC LIMIT 1";
$dbs->execute();
$dbh = $dbs->fetchrow_hashref;
$multi_maxpage = $dbh->{'endpage'};
-
+$indexpage = $dbh->{'indexpage'};
$showpagediff = $dbh->{'showpagediff'};
if ( !( $showpagediff > 0 ) ) {
$showpagediff = "0";
$template->param( homelink => $homelink );
$template->param( title_id => $title_group );
$template->param( nowspd => $showpagediff );
+ $template->param( indexpage => $indexpage );
}
print $cgi->header( -charset => 'utf-8' ), $template->output;
print qq {<th>showpagediff</th>\n};
- #print qq {<th>indexpage</th>\n};
+ print qq {<th>indexpage</th>\n};
print qq {</tr>\n};
foreach my $line ( @{$ary_ref} ) {
print qq {<tr>\n};
print qq {<td>$line->{showpagediff}</td>\n};
- #print qq {<td>$line->{indexpage}</td>\n};
+ print qq {<td>$line->{indexpage}</td>\n};
print qq {</tr>\n};
}
print qq {</table>\n};
}
})
.click(function(){
- window.location.href="<TMPL_VAR NAME="blink">";
+ var index_link="<TMPL_VAR NAME="jumplink">"+$("#index_num").val();
+ window.location.href=index_link;
});
$("#spd_dialog").dialog({
autoOpen:false,
}).click(function(){
$("#spd_dialog").dialog('open');
});
-
+ $("#setting_index_button").button({
+ label:"目次設定",
+ icons:{
+ primary:"ui-icon-copy"
+ }
+ }).click(function(){
+ $("#index_dialog").dialog('open');
+ });
$("#genre_button").button({
label:"Genre設定",
icons:{
}
$("#genre_dialog").dialog('close');
});
+ $("#index_dialog").dialog({
+ autoOpen:false,
+ //height:140,
+ width:260,
+ modal:true,
+ title:"Index Setting"
+ });
+ $("#index_button").button({
+ label:"Index設定",
+ icons:{
+ primary:"ui-icon-copy"
+ }
+ })
+ .click(function(){
+ var indexnum=parseInt($("#index_text").val())+parseInt($("#spd_num").val());
+ console.log(indexnum);
+ if (indexnum>0){
+ $.ajax({
+ type:"GET",
+ url:"pdfmanager.pl",
+ data:{
+ mode : 'index',
+ title : '<TMPL_VAR NAME="title_id">',
+ index : indexnum
+ }
+ })
+ }
+ $("#index_dialog").dialog('close');
+ });
$("#login").button({
label:"ログイン",
icons:{
$.get('<TMPL_VAR NAME="blink_jpeg">');
$.get('<TMPL_VAR NAME="blink_jpeg2">');
$.get('<TMPL_VAR NAME="nlink_jpeg">');
- $.get('<TMPL_VAR NAME="nlink_jpeg2">');
+ $.get('<TMPL_VAR NAME="nlink_jpeg2">');
+ console.log($("#index_num").val());
+ if (parseInt($("#index_num").val()) > 0){
+ $("#index").button("enable");
+ }
};
});
<br>
<button type="button" id="genre_button">設定</button>
</div>
+ <div id="index_dialog" align="right">
+ <input type="number" width="100%" id="index_text" value="<TMPL_VAR NAME="indexnum">" max="<TMPL_VAR NAME="maxpage">" class="ui-corner-all"/>
+ <br>
+ <br>
+ <button type="button" id="index_button">設定</button>
+ </div>
<div id="settings_dialog" align="center">
<button type="button" id="setting_genre_button">ジャンル設定</button><br>
- <button type="button" id="setting_spd_button">SPD設定</button><br><hr>
+ <button type="button" id="setting_spd_button">SPD設定</button><br>
+ <button type="button" id="setting_index_button">Index設定</button><br><hr>
<!--<div id="setting_showpage_ratio" disabled>
<input type="radio" id="show_1p" checked="checked" name="radio"/>
<label for="show_1p">1p</label>
</div>
<input type="hidden" value="<TMPL_VAR NAME="nowpage">" id="nowpage"/>
<input type="hidden" value="<TMPL_VAR NAME="maxpage">" id="maxpage"/>
+ <input type="hidden" value="<TMPL_VAR NAME="indexpage">" id="index_num"/>
+
</form>
</body>
</html>