Jump to content

Kashmenon

New Members
  • Posts

    7
  • Joined

  • Last visited

Kashmenon's Achievements

Newbie

Newbie (1/5)

0

Reputation

1

Community Answers

  1. Hi Barand I played around with it a lot and this one worked for me $output .= '<input '.$checked.' type="radio" name="fav_id[]" value="'.$sep_row['av_id'].'" /> <img src="/the foldername/'.$sep_row['av_image']. '" />'; Thank you so much for the input. Cheers
  2. Hi Barand Thank you for the advice I had already tried this $output .= '<input '.$checked.' type="radio" name="fav_id[]" value="'.$sep_row['av_id'].'" />'.echo "<img src=../../images/dot/'{$sep_row['av_image']}'>"; I get this error " XMLHTTP" Internal server occured Please let me know if i am doing it wrong. Appreciate it
  3. The code below is what helps me to display radio buttons on the website. The radio buttons are now in text format. The images are stored in a folder on my server. $sep_row['av_image'] displays the name of the image. but i want to display this in png format. Thank you for the help in advance. $i=1; $avaQuery ="SELECT * FROM dd_ava_mst ORDER BY av_code_name"; $seldata_cat = $obj->selectQuery($avaQuery); if($q==2) { $output .= '<b style="color: #000000;">Availability:</b>'; $output .= "<table width=\"400\" border=\"0\" >\n"; //open table tag while($sep_row = mysql_fetch_array($seldata_cat)){ $checked = ''; if(in_array($sep_row['av_id'], $fdiva_cat_sub_array)){ $checked = 'checked="checked"'; } if($i==1) { $output .= "<tr class='yl_tb'>"; } $output .= "<td class='yl_tb' >"; $output .= '<input '.$checked.' type="radio" name="fav_id[]" value="'.$sep_row['av_id'].'" />'.$sep_row['av_image']; $output .= "</td>\n"; if($i==3) { $output .= "</tr>"; $i=0; } $i++; } $output .= "</table>\n"; } This is the output now Availability: Green.png Orange.png Orange.png red.png
  4. Hi I have been struggling to get this option incorporated into the following code Requirement :- What should I do to select the emails in the following image and email them all directly from outlook with mail() option. They should have checkboxes next to them or some other method with which we can select them. The emails are all stored in an SQL Database. Please do let me know. Thank you for all the help in advance. <?php include("includes/header.php"); include("../../lib/master_include.php"); require_once('includes/pagination.php'); $modelCatJs = array(); //Use for checkbox checked on form submit $fsexVal = ''; if(isset($_GET['del_model_id'])){ //$HTTP_HOST = $_SERVER["HTTP_HOST"]; //if ($HTTP_HOST == "localhost") { //$con=mysqli_connect("localhost","user","pass","db"); //} //if ($HTTP_HOST == "website" || $HTTP_HOST == "website") { $con=mysql_connect("localhost","user","pass"); mysql_select_db("db", $con); //} if($_SESSION['LateItWebAdmin']['sID']==1) { mysql_query("DELETE FROM model_data WHERE fmodel_id = '".$_GET['del_model_id']."'"); //$obj->Query("DELETE FROM model_data WHERE fmodel_id = '".$_GET['del_model_id']."'"); $select_images_models = $obj->selectQuery("SELECT * FROM model_image WHERE fmodel_id = '".$_GET['del_model_id']."'"); while($row_model_images = mysql_fetch_array($select_images_models)){ unlink('../../model/'.$row_model_images['image_name']); } //$obj->Query("DELETE FROM model_image WHERE fmodel_id = '".$_GET['del_model_id']."'"); $qury = mysql_query("DELETE FROM model_image WHERE fmodel_id = '".$_GET['del_model_id']."'"); //print_r($qury); echo 'Record Deleted'; } else { echo "You can't delete any model information."; } } //Pagination if(!isset($_REQUEST['page'])){ $page = 1; }else{ $page = $_REQUEST['page']; } if(!isset($_REQUEST['start'])){ $start = 0; }else{ $start = $_REQUEST['start']; } $perpage = 20; $start=($page-1)*$perpage; $seldata = $obj->selectQuery("SELECT * FROM model_data"); $RecordCount = mysql_num_rows($seldata); //End Pagination if(isset($_REQUEST['searchbtn'])){ (!empty($_REQUEST['fmodel_id'])) ? $_REQUEST['fmodel_id'] = $_REQUEST['fmodel_id']: $_REQUEST['fmodel_id'] = ''; (!empty($_REQUEST['searchbtn'])) ? $_REQUEST['searchbtn'] = $_REQUEST['searchbtn'] : $_REQUEST['searchbtn'] = ''; $search_name = $_REQUEST['search_name']; $fsex1 = $_REQUEST['fsex1']; $where = " AND ffirst_name LIKE '%$search_name%' AND fsex LIKE '%$fsex1%'"; $search_for_divacat = $_REQUEST['search_for_divacat']; if(!empty($search_for_divacat)){ $where .= "AND fdiva_cat = '$search_for_divacat'"; } $search_by = $_REQUEST['search_by_dd']; $search_val = trim($_REQUEST['search_val'], ' '); if($search_val=='african' || $search_val == 'African') { $ethen_id = 6; } else if($search_val=='Arabic' || $search_val == 'arabic') { $ethen_id = 13; } else if($search_val=='European' || $search_val == 'european') { $ethen_id = 5; } else if($search_val=='Indian' || $search_val == 'indian') { $ethen_id = 2; } else if($search_val=='Mediterranean' || $search_val == 'mediterranean') { $ethen_id = 26; } else if($search_val=='Oriental' || $search_val == 'oriental') { $ethen_id = 4; } switch($search_by){ case "fsearch_all": //echo "SELECT * FROM model_data WHERE ffirst_name LIKE '%$search_name%' $where"; $seldata_num = $obj->selectQuery("SELECT * FROM model_data WHERE ffirst_name LIKE '%$search_name%' $where"); $seldata = $obj->selectQuery("SELECT * FROM model_data WHERE ffirst_name LIKE '%$search_name%' $where ORDER BY ffirst_name ASC Limit $start, $perpage"); break; case "fmodel_id": $seldata_num = $obj->selectQuery("SELECT * FROM model_data WHERE id LIKE '%$search_val%' $where"); $seldata = $obj->selectQuery("SELECT * FROM model_data WHERE id LIKE '%$search_val%' $where ORDER BY fmodel_id DESC Limit $start, $perpage"); break; case "fethnicity": $seldata_num = $obj->selectQuery("SELECT * FROM model_data WHERE feth_id='$ethen_id' $where"); $seldata = $obj->selectQuery("SELECT * FROM model_data WHERE feth_id='$ethen_id' $where ORDER BY fmodel_id DESC Limit $start, $perpage"); break; /*case "fsex": $seldata_num = $obj->selectQuery("SELECT * FROM model_data WHERE fsex LIKE '%$search_val%' $where"); $seldata = $obj->selectQuery("SELECT * FROM model_data WHERE fsex LIKE '%$search_val%' $where ORDER BY fmodel_id DESC Limit $start, $perpage"); break;*/ /*case "ffname": $seldata_num = $obj->selectQuery("SELECT * FROM model_data WHERE ffirst_name LIKE '%$search_val%' $where"); $seldata = $obj->selectQuery("SELECT * FROM model_data WHERE ffirst_name LIKE '%$search_val%' $where ORDER BY ffirst_name ASC Limit $start, $perpage"); break;*/ case "femail": $seldata_num = $obj->selectQuery("SELECT * FROM model_data WHERE femail LIKE '%$search_val%' $where"); $seldata = $obj->selectQuery("SELECT * FROM model_data WHERE femail LIKE '%$search_val%' $where ORDER BY fmodel_id DESC Limit $start, $perpage"); break; case "fcontact_no": $seldata_num = $obj->selectQuery("SELECT * FROM model_data WHERE (fcontact_no LIKE '%$search_val%' OR fmobile LIKE '%$search_val%') $where"); $seldata = $obj->selectQuery("SELECT * FROM model_data WHERE (fcontact_no LIKE '%$search_val%' OR fmobile LIKE '%$search_val%') $where ORDER BY fmodel_id DESC Limit $start, $perpage"); break; case "fnation": $seldata_num = $obj->selectQuery("SELECT * FROM model_data WHERE (fnation LIKE '%$search_val%') $where"); $seldata = $obj->selectQuery("SELECT * FROM model_data WHERE (fnation LIKE '%$search_val%') $where ORDER BY fmodel_id DESC Limit $start, $perpage"); break; case "fcity": $seldata_num = $obj->selectQuery("SELECT * FROM model_data WHERE fcity LIKE '%$search_val%' $where"); $seldata = $obj->selectQuery("SELECT * FROM model_data WHERE fcity LIKE '%$search_val%' $where ORDER BY fmodel_id DESC Limit $start, $perpage"); break; default: echo 'Not a valid condition'; } } else { unset($_REQUEST); if(isset($_GET['type']) && $_GET['type']=='active'){ $seldata = $obj->selectQuery("SELECT * FROM model_data where fstatus = 'Y' ORDER BY fmodel_id DESC Limit $start, $perpage"); }elseif(isset($_GET['type']) && $_GET['type']=='in-active'){ $seldata = $obj->selectQuery("SELECT * FROM model_data fstatus = 'N' ORDER BY fmodel_id DESC Limit $start, $perpage"); }else{ $seldata_num = $obj->selectQuery("SELECT * FROM model_data"); $seldata = $obj->selectQuery("SELECT * FROM model_data ORDER BY id DESC Limit $start, $perpage"); } } $RecordCount = mysql_num_rows($seldata_num); if (isset($_POST['btn_del'])) { $req = $_POST['del_id']; // $id = $_POST['id']; for ($i=0; $i<count($req); $i++) { if ($req[$i]) { // $res = $obj->Query("DELETE FROM model_data WHERE fmodel_id = '".$req[$i]."'"); $res = $obj->Query("DELETE FROM model_data WHERE id = '".$req[$i]."'"); $res1 = $obj->Query("DELETE FROM model_image WHERE fmodel_id = '".$req[$i]."'"); $imgpath = $obj->selectQuery("select image_name FROM model_image WHERE fmodel_id = '".$req[$i]."'"); $img_rows = mysql_fetch_array($imgpath); exit; for($j=0; $j < count($img_rows); $j++) { $path = "../model/".$img_rows[$j]; unlink($path); } //$res = $cms_page->delete_page($req[$i]); if($res === false){ $errors .= 'This page Could not be deleted.<br>'; } //clearAllCacheFromAdmin(); } } if($errors == ''){ $msg = urlencode("Record_deleted_successfully"); } else{ $msg = urlencode($errors); } header("Location: manage_models.php?msg=$msg"); } if (isset($_POST['update_order'])) { $sort = $_POST['sort']; $id = $_POST['id']; for ($i=0; $i<count($sort); $i++) { if ($sort[$i]) { $res = $obj->Query("UPDATE web_faq SET faq_order = '".abs(round($sort[$i]))."' WHERE faqID = '".$id[$i]."'"); // $res = $cms_page->update_sort_order(abs(round($sort[$i])), $id[$i]); if($res === false){ $errors .= 'This page Could not be updated.<br>'; } //clearAllCacheFromAdmin(); } } if($errors == ''){ $msg = urlencode("Record_Updated_Successfully"); } else{ $msg = urlencode($errors); } header("Location: manage_faq.php?msg=$msg"); } ?> <style type="text/css"> #navigat { color: #000000; font: 14px/24px sans-serif; margin: 0 auto; padding: 0; width: 100%; float:left; margin-bottom:15px; } #navigat .btn { border-radius: 5px 5px 5px 5px; color: #000000; display: inline-block; font-size: 0.875em; padding: 10px; } #navigat .paginat { float: right; margin-bottom: 0; padding: 0; } #navigat .page { background: none repeat scroll 0 0 #E9E9E9; border: 1px solid #c6c6c6; border-radius: 3px 3px 3px 3px; box-shadow: 0 1px 0 rgba(255, 255, 255, 0. inset, 0 1px 3px rgba(0, 0, 0, 0.1); color: #000000; display: inline-block; font-size: 0.875em; font-weight: bold; margin-right: 4px; padding: 0 9px; text-decoration: none; text-shadow: 0 1px 0 #FFFFFF; } #navigat .page:hover, #navigat .page.gradient:hover { background: none repeat scroll 0 0 #333333; border: 1px solid #333333; color: #FFFFFF; } #navigat .page.active { background: none repeat scroll 0 0 #333333; border: medium none; box-shadow: 0 0 8px rgba(0, 0, 0, 0.5) inset, 0 1px 0 rgba(255, 255, 255, 0. ; color: #F0F0F0; text-shadow: 0 0 3px rgba(0, 0, 0, 0.5); } #navigat .page.gradient { background: none repeat scroll 0 0 #c6c6c6; } </style> <?php if(isset($_GET['msg'])){ ?><div class="n_ok"><p><?php echo str_replace("_"," ",$_GET['msg']); ?></p></div><?php } ?> <div class="entry" style="float:left; margin-left:10px;"> <form action="" method="get" name="sfrm" id="sfrm" > <div class="rt"> <?php /*?> <select name="blocked_mod" id="blocked_mod" onchange="change_stat();" > <option <?php if(isset($_GET['type']) && $_GET['type']=='all'){ echo 'selected="selected"';} ?> value="all">All</option> <option <?php if(isset($_GET['type']) && $_GET['type']=='active'){ echo 'selected="selected"';} ?> value="active">Active</option> <option <?php if(isset($_GET['type']) && $_GET['type']=='in-active'){ echo 'selected="selected"';} ?> value="in-active">In-Active</option> </select><?php */?> <div class="chkBobexs"> <table class='tabwhite' border="0" width="600"cellpadding="0" cellspacing="0"> <tr> <td class='yl_tb'> </td> <td class='yl_tb' height='25' align="right">Search For</td> <td class='yl_tb1' style="padding-left:14px"> <select size="1" name="search_for_divacat" id="search_for_divacat" style="width:195px;"> <option value="">Search For All</option> <option value="1"> MODELS </option> <option value="2"> PROMOTERS </option> <option value="3"> CAST </option> <option value="4"> STYLISTS </option> <option value="5"> LOCATIONS </option> <option value="6"> PHOTOGRAPHERS </option> <option value="7"> ENTERTAINERS </option> <option value="8"> EVENTS </option> <option value="9"> PUBLIC RELATIONS </option> <option value="10"> PRODUCTION </option> <option value="11"> STOCK IMAGES </option> <option value="12"> OUR WORK </option> <option value="13"> DIRECTORS </option> <option value="14"> AWARDS </option> </select> </td> </tr> <tr> <td class='yl_tb'> </td> <td class='yl_tb' height='25' align="right">Gender</td> <td class='yl_tb1' style="padding-left:14px"> <select size="1" name="fsex1" class="yl_tb2" style="width:195px;" id="fsex1"> <option value="">All</option> <option value="M">Male</option> <option value="F">Female</option> <option value="B">Boy</option> <option value="G">Girl</option> </select> </td> </tr> <tr> <td class='yl_tb'> </td> <td class='yl_tb' height='25' align="right">Name</td> <td style="padding-left:14px"><input type="text" name="search_name" value=""></td> </tr> <tr> <td class='yl_tb'> </td> <td class='yl_tb' height='25' align="right">Search By</td> <td class='yl_tb1' style="padding-left:14px"> <select size="1" name="search_by_dd" id="search_by_dd" style="width:195px;"> <option value="fsearch_all">Search for All</option> <option value="fmodel_id">ID</option> <option value="fethnicity">Ethnicity</option> <!--<option value='fsex'>Gender</option>--> <!--<option value='ffname'>Name</option>--> <option value='femail'>Email</option> <option value='fcontact_no'>Contact Number</option> <option value='fcity'>City</option> <option value='fnation'>Nationality</option> <option value='fage'>Age</option> </select> </td> </tr> <tr> <td width="15"> </td> <td width="66" class='yl_tb' height='25' align="right">Search Value</font></td> <td style="padding-left:14px" id="search_by"> <input type="text" name="search_val" class="number" placeholder="" /> </td> </tr> <tr> <td class='yl_tb'> </td> <td class='yl_tb'> <td class='yl_tb'><div align="right" style="padding-right:70px"> <input name="searchbtn" type="submit" class="" id="searchbtn" value="Search" style="cursor:pointer;" /> </div></td> </tr> </table> </div> </div> </form> </div> <form name="form1" class="serach_form" id="form1" method="post" action=""> <div class="entry"> <div class="sep"></div> <div class="rt"> <a class="button add" href="add_new_model.php">Add New Model</a> <?php /*?><?php if($_SESSION['LateItWebAdmin']['username']=='superadmin' || $_SESSION['LateItWebAdmin']['sID']== 1 || $_SESSION['LateItWebAdmin']['username']=='Nicole') { if($RecordCount>0){ ?> <input name="btn_del" class="cancel Button" type="submit" id="btn_del" onclick="return validate_msg('Select any checkbox to delete','Are you sure you want to delete this Record?');" value="Delete Selected" /> <?php } } ?><?php */?> </div> </div> <div style="clear:both"></div> <?php if($RecordCount>0){ ?> <table width="100%"> <thead> <tr> <th width="5%" >ID</th> <th width="10%" >Image</th> <th width="10%" >Detail</th> <th width="10%" >Gender</th> <th width="5%" >Category</th> <th width="10%" >Nationality</th> <th width="15%" >Modify</th> </tr> </thead> <tbody> <?php while($rowfe = mysql_fetch_array($seldata)) { ?> <?php ?> <tr> <td align="center"><?php echo $rowfe['id']; ?></td> <td align="center"><?php $imageseldata = $obj->selectQuery("SELECT * FROM model_image WHERE fmodel_id = '".$rowfe['fmodel_id']."' ORDER BY disp_priority DESC LIMIT 1"); $i_row = mysql_fetch_array($imageseldata); if($i_row['image_name'] != '') { ?> <a href="http://divadubai.com/search_detail.php?mod_id=<?=$rowfe['fmodel_id']?>&search_for=models&category=1" target="_blank"><img src="../../model/<?php echo $i_row['image_name']; ?>" height="60" width="60" /></a> <?php } else{ ?> <a href="http://divadubai.com/search_detail.php?mod_id=<?=$rowfe['fmodel_id']?>&search_for=events&category=1" target="_blank"><img src="../images/60x60.gif" height="60" width="60" /></a> <?php } ?> </td> <td align="center"> <table> <tr><td>Name: <a href="model_detail.php?id=<?php echo $rowfe['id']; ?>"><?php echo $rowfe['ffirst_name'].' '.$rowfe['flast_name']; ?> </a> </td> </tr> <tr><td>Email: <?php echo $rowfe['femail']; ?></td> </tr> <?php $dobyear = date('Y',strtotime($rowfe['fdateofbirth'])); $curyear = date('Y'); $ages = $curyear - $dobyear;?> <tr><td>Age:<?php echo $ages.'{'.$rowfe['fdateofbirth'].'}'; ?></td> </tr> <tr><td>Mobile: <?php if(!empty($rowfe['fmobile_no'])) echo $rowfe['fmobile_no']; else echo $rowfe['fmobile']; ?></td></tr> </table> </td> <td align="center"><?php if($rowfe['fsex']=='F'){ echo 'Female';}elseif($rowfe['fsex']=='ma' || $rowfe['fsex']=='m' || $rowfe['fsex']=='M'){ echo 'Male';}elseif($rowfe['fsex']=='G'){ echo 'Girl'; }elseif($rowfe['fsex']=='B'){ echo 'Boy'; } ?></td> <td align="center"><?php echo $rowfe['fdiva_cat']; ?></td> <td align="center"><?php echo $rowfe['fnation']; ?></td> <td> <a href="../../preview.php?mid=<?php echo $rowfe['id'];?>&catid=<?php echo $rowfe['fdiva_cat']; ?>" target="_blank">Preview</a><br /> <a href="add_new_model_edit.php?id=<?php echo $rowfe['id'];?>" class="table-icon edit" title="Edit"></a> <a href="edit_model_image.php?id=<?php echo $rowfe['fmodel_id'];?>" class="edit" title="Edit Image">Edit Image</a> <br /> <a href="?del_model_id=<?php echo $rowfe['fmodel_id'];?>" onclick="return confirm('Really delete?');">Delete Record?</a> </td> </tr> <?php } ?> </tbody> </table> <?php } else { echo ' <div class="entry">'; echo '<div class="n_warning"><p>No Record Found!</p></div></div'; }?> </form> <?php if(isset($_REQUEST['searchbtn'])){ /*echo pagination($perpage,$page, 'http://divadubai.com/new_admin/div-admin/manage_models.php?blocked_mod='.$_REQUEST['blocked_mod'].'&search_for_divacat='.$_REQUEST['search_for_divacat'].'&search_by_dd='.$_REQUEST['search_by_dd'].'&fmodel_id='.$_REQUEST['fmodel_id'].'&search_val='.$_REQUEST['search_val'].'&fcity='.$_REQUEST['fcity'].'&searchbtn=Serach&start='.$start.'&perpage='.$perpage.'&page=',$RecordCount);*/ //call function to show pagination echo pagination($perpage,$page, 'http://divadubai.com/admin/admin/manage_models.php?search_for_divacat='.$_REQUEST['search_for_divacat'].'&fsex1='.$fsex1.'&search_name='.$search_name.'&search_by_dd='.$_REQUEST['search_by_dd'].'&fsearch_all=&search_val='.$_REQUEST['search_val'].'&searchbtn=Serach&start='.$start.'&perpage='.$perpage.'&page=',$RecordCount); }else{ echo pagination($perpage,$page, 'http://divadubai.com/admin/admin/manage_models.php?start='.$start.'&perpage='.$perpage.'&page=',$RecordCount); //call function to show pagination } ?> </div> </div> <div class="clear"></div> </div> </div> </div> </div> </div> <?php $nationality = $obj->selectQuery("SELECT DISTINCT fnation FROM model_data ORDER BY fnation ASC"); $nationality_html = '<select name="search_val">'; while($nationality_res = mysql_fetch_object($nationality )){ $nationality_html .= '<option value="'.$nationality_res->fnation.'">'.$nationality_res->fnation.'</option>'; } $nationality_html .= '</select>'; ?> <script type="text/javascript" language="javascript"> function change_stat(){ var val = $('#blocked_mod').val(); var url = '<?php echo 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; ?>'+'?type='+val; window.location.href = url; } $(document).ready(function(){ $('#search_by_dd').change(function(){ var search_by = $(this).val(); if(search_by == 'fsearch_all'){ $('#search_by').html('<input type="text" name="search_val" class="" placeholder="" />'); } else if(search_by == 'fmodel_id'){ $('#search_by').html('<input type="text" name="search_val" class="required number" placeholder="Enter Model Id" required="required" />'); }else if(search_by == 'ffname'){ $('#search_by').html('<input type="text" name="search_val" class="required" placeholder="Enter Model Name" required="required" />'); }else if(search_by == 'femail'){ $('#search_by').html('<input type="text" name="search_val" class="required email" placeholder="Enter Model email" required="required" />'); }else if(search_by == 'fcontact_no'){ $('#search_by').html('<input type="text" name="search_val" class="required" placeholder="Enter Model Contact Number" required="required" />'); }else if(search_by == 'fnation'){ $('#search_by').html('<input type="text" name="search_val" class="required" placeholder="Enter Model Nationality" required="required" />'); }else if(search_by == 'fsex'){ $('#search_by').html('<select size="1" name="search_val" class="yl_tb2 valid" style="width:195px;" id="fsex"><option value="">All</option><option value="M">Male</option><option value="F">Female</option><option value="B">Boy</option><option value="G">Girl</option></select>'); }else if(search_by == 'fcity'){ $('#search_by').html('<input type="text" name="search_val" class="required" placeholder="Enter Model City" required="required" />'); } }); $('#fsex').val('<?=$fsexVal?>'); var fsexLoad = $('#fsex').val('<?=$fsexVal?>'); $('#fsex').change(function(){ var fsexVal = $('#fsex').val(); if(fsexVal == 'B' || fsexVal == 'G'){ $('#ageGender').slideDown('fast'); }else{ $('#ageGender').slideUp('fast'); $('#fage').val(''); } }); }); </script> <?php include("includes/footer.php"); ?>
  5. Thank you Gizmola. Will follow Quick Old Car's prepared statements
  6. Thank you Ch0cu3r and QuickOldCar for your inputs. Appreciate the help a lot. I am just a beginner at coding but i would like to learn more about this. @ QuickOldCar :- Yes the model ID is always a number which is either 4 or 5 digits. So I will use the ctype to validate the ID. Hopefully there wont be any attacks with that. @Ch0cu3r :- I will look into the links mentioned and will try to get a workaround for my code. XSS Cross Scripting errors showed up on the Malware cleanup. I did not think how this would logically pan out when this was done. Thank you again.
  7. My website is always under constant attack and i had to purchase sucuri, i want to put this code back up but i need to eliminate the SQL injection <?php require_once('meta/header.php'); $model_id = $_REQUEST['mod_id']; $search_for = $_REQUEST['search_for']; $category = $_REQUEST['category']; $search_gender = $_REQUEST['search_gender']; $session_index_for_card = $_REQUEST['session_index']; $session_index_next = $session_index_for_card + 1; $mod_id_next = $_SESSION['model_array'][$session_index_next]; $session_index_prev = $session_index_for_card - 1; $mod_id_prev = $_SESSION['model_array'][$session_index_prev]; $model_imgQuery = "SELECT image_name FROM model_image WHERE fmodel_id = '".$model_id."' ORDER BY disp_priority DESC"; $model_imgQuery_exec = $db->query($model_imgQuery); $model_imgQuery_result = $db->fetch_all_array($model_imgQuery_exec); ?> <script> $(document).ready(function(){ $('#contentHeading').html('Full Catalog'); $('#breadcrumb').html('<a href="<?=BASE_URL?>">Home</a>><a href="#">Full Catalog</a>'); <?php if($session_index_prev == '-1'){ ?> $('#prev_card').removeAttr('href'); <?php } if($session_index_next == count($_SESSION['model_array'])){ ?> $('#next_card').removeAttr('href'); <?php } ?> }); </script> <link rel="stylesheet" type="text/css" href="assets/js/full_catalog_slider/css/style.css" /> <link rel="stylesheet" type="text/css" href="assets/js/full_catalog_slider/fancybox/jquery.fancybox-1.3.1.css" media="screen" /> <style> .bigImg{overflow:auto; float:right !important; width:735px; max-height:320px; overflow-y: hidden;} /*.big_img img{float:left !important;}*/ .catalague{left:375px; top:670px;} iframe{height:100%; width:330%; border:0;} .links_detail{margin-right:0 !important;} </style> <div id="content"> <div class="links_detail"> <a href="<?=BASE_URL?>full_catalog.php?mod_id=<?=$mod_id_next?>&search_for=<?=$search_for?>&category=<?=$category?>&session_index=<?=$session_index_next?>" id="next_card">NEXT CARD</a> | <a href="<?=BASE_URL?>full_catalog.php?mod_id=<?=$mod_id_prev?>&search_for=<?=$search_for?>&category=<?=$category?>&session_index=<?=$session_index_prev?>" id="prev_card">PREVIOUS CARD</a> | <a href="<?=BASE_URL.$search_for?>.php">START NEW SEARCH</a> | <a href="javascript:window.history.go(-1)">BACK</a> </div> <div class="bigImg"> <div class="gallery-wrap"> <div class="gallery clearfix"> <?php foreach($model_imgQuery_result as $img): ?> <div class="gallery__item"> <a rel="example_group" href="<?=BASE_URL?>model/<?=$img['image_name']?>" class="gallery__link"> <img src="<?=BASE_URL?>model/<?=$img['image_name']?>" class="gallery__img" alt="" /> </a> </div> <?php endforeach; ?> </div> <!-- .gallery --> </div> </div> <div class="gallery__controls clearfix"> <div href="#" class="gallery__controls-prev"> <img src="assets/js/full_catalog_slider/images/prev.png" alt="" /> </div> <div href="#" class="gallery__controls-next"> <img src="assets/js/full_catalog_slider/images/next.png" alt="" /> </div> </div> <!-- .gallery__controls --> <div class="catalague"> <!--<img alt="" src="<?=BASE_URL?>assets/images/fullcatalogue.png"> <a href="<?=BASE_URL?>full_catalog.php?mod_id=<?=$model_id?>&search_for=<?=$search_for?>"> SEE FULL CATALOGUE</a> --> <?php require_once("meta/search_tools.php"); ?> </div> </div> </div> </div> <script type="text/javascript"> // Only run everything once the page has completely loaded $(window).load(function(){ // Set general variables // ==================================================================== var totalWidth = 0; // Total width is calculated by looping through each gallery item and // adding up each width and storing that in `totalWidth` $(".gallery__item").each(function(){ totalWidth = totalWidth + $(this).outerWidth(true); }); // The maxScrollPosition is the furthest point the items should // ever scroll to. We always want the viewport to be full of images. var maxScrollPosition = totalWidth - $(".gallery-wrap").outerWidth(); // This is the core function that animates to the target item // ==================================================================== function toGalleryItem($targetItem){ // Make sure the target item exists, otherwise do nothing if($targetItem.length){ // The new position is just to the left of the targetItem var newPosition = $targetItem.position().left; // If the new position isn't greater than the maximum width if(newPosition <= maxScrollPosition){ // Add active class to the target item $targetItem.addClass("gallery__item--active"); // Remove the Active class from all other items $targetItem.siblings().removeClass("gallery__item--active"); // Animate .gallery element to the correct left position. $(".gallery").animate({ left : - newPosition }); } else { // Animate .gallery element to the correct left position. $(".gallery").animate({ left : - maxScrollPosition }); }; }; }; // Basic HTML manipulation // ==================================================================== // Set the gallery width to the totalWidth. This allows all items to // be on one line. $(".gallery").width(totalWidth); // Add active class to the first gallery item $(".gallery__item:first").addClass("gallery__item--active"); // When the prev button is clicked // ==================================================================== $(".gallery__controls-prev").click(function(){ // Set target item to the item before the active item var $targetItem = $(".gallery__item--active").prev(); toGalleryItem($targetItem); }); // When the next button is clicked // ==================================================================== $(".gallery__controls-next").click(function(){ // Set target item to the item after the active item var $targetItem = $(".gallery__item--active").next(); toGalleryItem($targetItem); }); }); </script> <script type="text/javascript" src="assets/js/full_catalog_slider/fancybox/jquery.fancybox-1.3.1.js"></script> <script type="text/javascript"> // Fancybox specific // To make images pretty. Not important $(document).ready(function(){ $(".gallery__link").fancybox({ 'titleShow' : false, 'transitionIn' : 'elastic', 'transitionOut' : 'elastic' }); }); </script> <?php require_once('meta/footer.php'); ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.