Files
Testing/js/act/xtube_form.php
sean 0e8a8b3028
Some checks are pending
deploy-testing / deploy (push) Waiting to run
Initial testing snapshot
2026-11-17 16:15:01 -05:00

192 lines
5.8 KiB
PHP

<?php if ( !defined('PATHTOINCLUDES') ) define('PATHTOINCLUDES', $_SERVER["DOCUMENT_ROOT"] . '/cmeter/');
include(PATHTOINCLUDES."base.php");
$em="";
$sql="SELECT
`you_x_tube`.`id`,
`you_x_tube`.`imgurl`,
`you_x_tube`.`vid_id`,
`you_x_tube`.`thesort`,
`you_x_tube`.`vid_active`,
`you_x_tube`.`ytfeatured`
FROM
`you_x_tube`
WHERE
`you_x_tube`.`xtube` = 'Y";
$result=$database->database_query($sql) or $em=$em.$database->database_error();
?>
<div class="xmlform" id="youtube_links" style="width:380px;">
<div class="xmlform_pad" style="height:220px;">
<div>
<?php
$rownum=0;
while ($row = $database->database_fetch_assoc($result)) {$rownum=$rownum+1;?>
<div id="youtube_info_<?php echo $rownum;?>">
<div style="clear:both;"><label>Active: </label>
<input type="checkbox" class="checkbox"
name="vid_active_<?php echo $rownum;?>" id="vid_active_<?php echo $rownum;?>" value="Y"
onclick="submit_form_item('<?php echo $rownum;?>','vid_active_<?php echo $rownum;?>','/js/act/xtube_update.php','id_<?php echo $rownum;?>','you_x_tube','','N');"
<?php if($row["vid_active"]== "Y"){echo "checked=\"checked\"";}?>
/>
<label> Featured: </label>
<input type="checkbox" class="checkbox"
name="ytfeatured_<?php echo $rownum;?>" id="ytfeatured_<?php echo $rownum;?>" value="Y"
onclick="submit_form_item('<?php echo $rownum;?>','ytfeatured_<?php echo $rownum;?>','/js/act/xtube_update.php','id_<?php echo $rownum;?>','you_x_tube','','N');"
<?php if($row["ytfeatured"]== "Y"){echo "checked=\"checked\"";}?>
/>
</div>
<div style="clear:both;"><label>Video ID: </label><input type="text" required pattern="\S" class="text"
size="40" maxlength="32" name="vid_id_<?php echo $rownum;?>" id="vid_id_<?php echo $rownum;?>" value="<?php echo $row["vid_id"];?>"
onblur="submit_form_item('<?php echo $rownum;?>','vid_id_<?php echo $rownum;?>','/js/act/xtube_update.php','id_<?php echo $rownum;?>','you_x_tube','Please enter image url','N');" />
<input type="button"
class="bl_delbutton"
name="preview_<?php echo $rownum;?>"
id="preview_<?php echo $rownum;?>"
value="P" onclick="preview_xtube('<?php echo $rownum;?>');" />
</div>
<div style="clear:both;"><label>Image URL: </label><input type="text" required pattern="\S" class="text"
size="40" maxlength="250" name="imgurl_<?php echo $rownum;?>" id="imgurl_<?php echo $rownum;?>" value="<?php echo $row["imgurl"];?>"
onblur="submit_form_item('<?php echo $rownum;?>','imgurl_<?php echo $rownum;?>','/js/act/xtube_update.php','id_<?php echo $rownum;?>','you_x_tube','Please enter image url','N');" />
</div>
<div style="clear:both;"><label>Sort Order: </label><input type="text" required pattern="\S" class="text" style="width:40px;"
size="4" maxlength="4" name="thesort_<?php echo $rownum;?>" id="thesort_<?php echo $rownum;?>" value="<?php echo $row["thesort"];?>"
onblur="submit_form_item('<?php echo $rownum;?>','thesort_<?php echo $rownum;?>','/js/act/xtube_update.php','id_<?php echo $rownum;?>','you_x_tube','Please enter video order','N');" />
<input type="button"
class="bl_delbutton"
name="del_<?php echo $rownum;?>"
id="del_<?php echo $rownum;?>"
value="D" onclick="del_xtube('<?php echo $rownum;?>');" />
</div>
<input type="hidden" name="id_<?php echo $rownum;?>" id="id_<?php echo $rownum;?>" value="<?php echo $row["id"];?>" />
<input type="hidden" name="o_imgurl_<?php echo $rownum;?>" id="o_imgurl_<?php echo $rownum;?>" value="<?php echo $row["imgurl"]; ?>" />
<input type="hidden" name="o_vid_id_<?php echo $rownum;?>" id="o_vid_id_<?php echo $rownum;?>" value="<?php echo $row["vid_id"]; ?>" />
<input type="hidden" name="o_thesort_<?php echo $rownum;?>" id="o_thesort_<?php echo $rownum;?>" value="<?php echo $row["thesort"]; ?>" />
<input type="hidden" name="o_vid_active_<?php echo $rownum;?>" id="o_vid_active_<?php echo $rownum;?>" value="" />
<hr />
</div>
<?php }?>
</div>
</div>
<div style="background:red;color:#fff;width:400px;" id="youtube_add">
<div style="padding:10px;">
<div style="clear:both;"><label>Video ID: </label><input type="text" required pattern="\S" class="text"
name="vid_id" id="vid_id" size="40" maxlength="32"
onblur="" />
<input type="button"
class="bl_delbutton"
name="preview_<?php echo 0;?>"
id="preview_<?php echo 0;?>"
value="P" onclick="preview_xtube('');" />
</div>
<div style="clear:both;"><label>Image URL: </label><input type="text" required pattern="\S" class="text"
name="imgurl" id="imgurl" size="40" maxlength="250"
onblur="" /></div>
<div style="position:relative;clear:both;"><label>Sort Order: </label><input type="text" required pattern="^[0-9]+$" class="text"
name="thesort" id="thesort" size="4" maxlength="4" style="width:40px;"
onblur="" />
<label style="float:none;padding-left:10px;">Active: </label><input type="checkbox" class="checkbox"
name="vid_active" id="vid_active" value="Y"
onblur="" />
<input type="button" value="Add Video" onclick="add_xtube();" style="position:absolute;right:5px;bottom:0px;" /></div>
</div>
</div>
</div>