使用smarty模板、php和sql&;动态输出;javascript

使用smarty模板、php和sql&;动态输出;javascript,javascript,php,ajax,smarty,Javascript,Php,Ajax,Smarty,这些是我的文件: show\u booking\u career\u list.tpl <form action="" method="post" name="searching_form" id="searching_form"> <input type="hidden" name="sel_from_country" value="{$select_from}" /> <input type="hidden" name="sel_to_country"

这些是我的文件:

show\u booking\u career\u list.tpl

<form action="" method="post" name="searching_form" id="searching_form">
  <input type="hidden" name="sel_from_country" value="{$select_from}" />
  <input type="hidden" name="sel_to_country" value="{$select_to}" />
  <input type="hidden" name="parcel_booking_weight" value="{$select_weight}" />
  <input type="hidden" name="sel_booking_height" value="{$select_height}" />
  <input type="hidden" name="sel_booking_width" value="{$select_width}" />
  <input type="hidden" name="sel_booking_length" value="{$select_girth}" />
  <input type="hidden" name="search_service_id" id="search_service_id" value="{$search_service_id}" />

  <!--==zip code==-->
  <input type="hidden" name="sel_from_zipcode" value="{$smarty.session.sel_from_zipcode}" />
  <input type="hidden" name="sel_to_zipcode" value="{$smarty.session.sel_to_zipcode}" />
  <input type="hidden" name="sel_booking_type" value="{$smarty.session.sel_booking_type}" />

  <input type="hidden" name="post_booking_data" id="post_booking_data" value="submit" />
  <div id="">
    <div class="container " >
      <div class="row"> 
        {$functions->getPackageSerachingServiceLinks()}

{section name=data loop=$servicedata_searching} <a  onclick="seachingServiceValuePut({$servicedata_searching[data].sid})"   class="href_pointer">
        <div class="col-md-2 col-lg-2 col-sm-6 col-xs-6 center">
        {if $search_service_id==''}
          <div class="{if $servicedata_searching[data].sid==4}packbg1_active{else}packbg1{/if} padding5 border_radius5">
        {else}
          <div class="{if $servicedata_searching[data].sid==$search_service_id}packbg1_active{else}packbg1{/if} padding5 border_radius5">
        {/if}   
            <h4 class="white">{$servicedata_searching[data].sname}</h4>
            <p class="pink"><strong>
            From ${$functions->getMinimumValueParcelPackage($servicedata_searching[data].sid,$select_from,$select_to,$select_weight,$select_height,$select_width,$select_girth)}

            </strong></p>
          </div>
            <div>&nbsp;</div>
        </div>
        </a> {/section}</div></div> 
ajax.js

    function seachingServiceValuePut(sel_value)
{

    document.getElementById('search_service_id').value=sel_value;
    document.getElementById('searching_form').submit();
}
sql文件

 INSERT INTO `pb_services` (`sid`, `sname`, `sort_description`, `description`, `status`, `deleted`) VALUES
(1, 'Next Day Delivery', 'Next Day Deliverys', '<p>3+ Day Delivery</a></p>', 'Y', 'N'),
(2, '2 Day Delivery', '2 Day Delivery', '<p>3+ Day Delivery</a></p>', 'Y', 'N'),
(3, '3+ Day Delivery', '3+ Day Delivery', '<p>2 Days&nbsp;</p>', 'Y', 'N'),
(4, 'Same Day Delivery', '', 'same day', 'Y', 'N');


INSERT INTO `set_delivery_package_details` (`pac_id`, `unique_id`, `title`, `career_id`, `service_id`, `start_weight_range`, `end_weight_range`, `set_price`, `sel_countrys`, `dimesion_height`, `dimesion_width`, `dimesion_girth`, `dimesion_weight`, `service_type`, `delivery_within`, `collactions_made`, `fully_trackble`, `prienter_required`, `compensation`, `description`, `career_service_image_path`, `9am_delivery_charge`, `10am_delivery_charge`, `11am_delivery_charge`, `12am_delivery_charge`, `entry_date`, `from_time`, `to_time`, `status`, `deleted`) VALUES
(1, 'AAADLL', 'testing', 11, 1, '0', '1', '5', '94,222', '10', '10', '10', '300', 'L_D_O', '', '', 'Y', 'Y', '', '', '', '', '', '', '', '2015-06-20', '', '', 'Y', 'N'),
(2, 'AAADLL', 'testing', 11, 1, '2', '20', '10', '94,222', '10', '10', '10', '300', 'L_D_O', '', '', 'Y', 'Y', '', '', '', '', '', '', '', '2015-06-20', '', '', 'Y', 'N'),
(3, 'AAADLL', 'testing', 11, 1, '21', '50', '20', '94,222', '10', '10', '10', '300', 'L_D_O', '', '', 'Y', 'Y', '', '', '', '', '', '', '', '2015-06-20', '', '', 'Y', 'N'),
(4, 'AAADLL', 'testing', 11, 1, '51', '300', '30', '94,222', '10', '10', '10', '300', 'L_D_O', '', '', 'Y', 'Y', '', '', '', '', '', '', '', '2015-06-20', '', '', 'Y', 'N'),
(5, 'AAADLL', 'testing', 11, 1, '300', 'FLAT', '50', '94,222', '10', '10', '10', '300', 'L_D_O', '', '', 'Y', 'Y', '', '', '', '', '', '', '', '2015-06-20', '', '', 'Y', 'N'),
(6, 'IAVHUW', '23-6-2015', 11, 1, '0', '1', '5', '94,222', '20', '20', '20', '50', 'L_D_O', '2 days', '', 'Y', 'Y', 'this is info for compensation', '<p>Test description there.</p>', '', '10', '5', '5', '5', '2015-06-23', '01:00', '13:59', 'Y', 'N'),
(7, 'IAVHUW', '23-6-2015', 11, 1, '2', '20', '10', '94,222', '20', '20', '20', '50', 'L_D_O', '2 days', '', 'Y', 'Y', 'this is info for compensation', '<p>Test description there.</p>', '', '10', '5', '5', '5', '2015-06-23', '01:00', '13:59', 'Y', 'N'),
(8, 'IAVHUW', '23-6-2015', 11, 1, '21', '50', '10', '94,222', '20', '20', '20', '50', 'L_D_O', '2 days', '', 'Y', 'Y', 'this is info for compensation', '<p>Test description there.</p>', '', '10', '5', '5', '5', '2015-06-23', '01:00', '13:59', 'Y', 'N'),
(9, 'IAVHUW', '23-6-2015', 11, 1, '51', '300', '20', '94,222', '20', '20', '20', '50', 'L_D_O', '2 days', '', 'Y', 'Y', 'this is info for compensation', '<p>Test description there.</p>', '', '10', '5', '5', '5', '2015-06-23', '01:00', '13:59', 'Y', 'N'),
(10, 'IAVHUW', '23-6-2015', 11, 1, '300', 'FLAT', '25', '94,222', '20', '20', '20', '50', 'L_D_O', '2 days', '', 'Y', 'Y', 'this is info for compensation', '<p>Test description there.</p>', '', '10', '5', '5', '5', '2015-06-23', '01:00', '13:59', 'Y', 'N'),
(11, 'AFQCXL', '23 June 2015', 11, 1, '0', '1', '2', '94,222', '10', '10', '10', '15', 'L_D_O', '2', '', 'Y', 'Y', 'Info for comper', '<p>the desctripton</p>', '', '2', '5', '5', '10', '2015-06-23', '14:05', '17:02', 'Y', 'N'),
(12, 'AFQCXL', '23 June 2015', 11, 1, '2', '20', '4', '94,222', '10', '10', '10', '15', 'L_D_O', '2', '', 'Y', 'Y', 'Info for comper', '<p>the desctripton</p>', '', '2', '5', '5', '10', '2015-06-23', '14:05', '17:02', 'Y', 'N'),
(13, 'AFQCXL', '23 June 2015', 11, 1, '21', '50', '8', '94,222', '10', '10', '10', '15', 'L_D_O', '2', '', 'Y', 'Y', 'Info for comper', '<p>the desctripton</p>', '', '2', '5', '5', '10', '2015-06-23', '14:05', '17:02', 'Y', 'N'),
(14, 'AFQCXL', '23 June 2015', 11, 1, '51', '300', '10', '94,222', '10', '10', '10', '15', 'L_D_O', '2', '', 'Y', 'Y', 'Info for comper', '<p>the desctripton</p>', '', '2', '5', '5', '10', '2015-06-23', '14:05', '17:02', 'Y', 'N'),
(15, 'AFQCXL', '23 June 2015', 11, 1, '300', 'FLAT', '12', '94,222', '10', '10', '10', '15', 'L_D_O', '2', '', 'Y', 'Y', 'Info for comper', '<p>the desctripton</p>', '', '2', '5', '5', '10', '2015-06-23', '14:05', '17:02', 'Y', 'N');
插入到'pb\u服务'('sid`、'sname`、'sort\u description`、'description`、'status`、'deleted`)值中
(1,“第二天交货”、“第二天交货”、“第三天交货”、“Y”、“N”),
(2、‘2天交货’、‘2天交货’、‘3天交货’、‘Y’、‘N’,
(3、‘3天以上交货’、‘3天以上交货’、‘2天以上交货’、‘Y’、‘N’,
(4)“当日交货”、“当日交货”、“Y”、“N”);
插入“设置交付包详细信息”(`pac\u id`、`unique\u id`、`title`、`career\u id`、`service\u id`、`start\u weight\u range`、`end\u weight\u range`、`set\u price`、`sel\u countrys`、`Dimension\u height`、`Dimension\u girth`、`Dimension\u weight`、`service\u type`、`开始重量范围内交货`、`Collations\u制作`、`完全可跟踪`、`prienter\u所需`、`Dimension\u `、`薪酬`、`Dimension\u `、`service\u描述`、职业生涯`)ge路径“,”上午9点送货费“,”上午10点送货费“,”上午11点送货费“,”上午12点送货费“,”输入日期“,”从时间“,”到时间“,”状态“,”删除“)值
(1,'AAADLL','testing',11,1,'0','1','5','94222','10','10','10','300','L_D_O','','Y','Y','2015-06-20','Y','N',',
(2,'AAADLL','testing',11,1,'2','20','10','94222','10','10','300','L_D_O','','Y','Y','2015-06-20','Y','N',',
(3,'AAADLL','testing',11,1,'21','50','20','94222','10','10','10','300','L_D_O','','Y','Y','2015-06-20','Y','N',',
(4,'AAADLL','testing',11,1,'51','300','30','94222','10','10','10','300','L_D_O','','Y','Y','2015-06-20','Y','N',',
(5,'AAADLL','testing',11,1,'300','FLAT','50','94222','10','10','10','300','L_D_O','','Y','Y','2015-06-20','Y','N',',
(6,'IAVHUW','23-6-2015',11,1','0','1','5','94222','20','20','20','50','L_D_O','2天','Y','Y','S这是补偿信息','p>测试说明。

','10','5','5','2015-06-23','01:00','13:59','Y','N'), (7,‘IAVHUW’、‘23-6-2015’、‘11、1’、‘2’、‘20’、‘10’、‘94222’、‘20’、‘20’、‘20’、‘50’、‘2天’、‘Y’、‘Y’、‘这是补偿信息’、‘测试说明’、‘10’、‘5’、‘5’、‘2015-06-23’、‘01:00’、‘13:59’、‘Y’、‘N’, (8,'IAVHUW','23-6-2015',11,1','21','50','10','94222','20','20','20','50','L_D_O','2天','Y','Y','s这是补偿信息','p>测试说明。

','10','5','5','2015-06-23','01:00','13:59','Y','N', (9,'IAVHUW','23-6-2015',11,1','51','300','20','94222','20','20','50','L_D_O','2天','Y','Y','s这是补偿信息','p>测试说明。

','10','5','5','2015-06-23','01:00','13:59','Y','N'), (10,'IAVHUW','23-6-2015','11,1','300','FLAT','25','94222','20','20','20','50','L_D_O','2天','Y','Y','S这是补偿信息','p>测试说明。

,'10','5','5','2015-06-23','01:00','13:59','Y','N'), (11,‘AFQCXL’、‘2015年6月23日’、‘11、1、0’、‘1’、‘2’、‘94222’、‘10’、‘10’、‘10’、‘15’、‘L_D_O’、‘2’、‘Y’、‘Y’、‘comper信息’、‘desctripton’、‘2’、‘5’、‘10’、‘2015-06-23’、‘14:05’、‘17:02’、‘Y’、‘N’, (12,“AFQCXL”、“2015年6月23日”、“11、1、2、20”、“4”、“94222”、“10”、“10”、“10”、“15”、“L_D_O”、“2”、“Y”、“Y”、“comper信息”、“desctripton

”、“2”、“5”、“5”、“10”、“2015-06-23”、“14:05”、“17:02”、“Y”、“N”), (13,“AFQCXL”、“2015年6月23日”、“11、1、21”、“50”、“8”、“94222”、“10”、“10”、“10”、“15”、“L_D_O”、“2”、“Y”、“Y”、“comper信息”、“desctripton

”、“2”、“5”、“5”、“10”、“2015-06-23”、“14:05”、“17:02”、“Y”、“N”), (14,“AFQCXL”、“2015年6月23日”、“11、1、51”、“300”、“10”、“94222”、“10”、“10”、“15”、“L_D_O”、“2”、“Y”、“Y”、“comper信息”、“desctripton

”、“2”、“5”、“5”、“10”、“2015-06-23”、“14:05”、“17:02”、“Y”、“N”), (15,'AFQCXL','2015年6月23日',11,1,300','FLAT','12','94222','10','10','15','L_D_O','2','Y','Y','Y','comper信息','desctripton

,'2','5','5','10','2015-06-23','14:05','17:02','Y','N');
我有四个部分:当天交付、次日交付、2天以上交付、3天以上交付。我想激活有条目的部分,并停用没有条目的部分。 我正确地获得了所有的输出,但是当假设当天交付没有条目时,它仍然保持激活状态,我必须手动单击以查看其他部分

这里是截图:

这就是问题所在:

应该是这样的


谢谢您的编辑。请帮助我@SamTheDev谢谢您的编辑。请帮助我@SamTheDev
 INSERT INTO `pb_services` (`sid`, `sname`, `sort_description`, `description`, `status`, `deleted`) VALUES
(1, 'Next Day Delivery', 'Next Day Deliverys', '<p>3+ Day Delivery</a></p>', 'Y', 'N'),
(2, '2 Day Delivery', '2 Day Delivery', '<p>3+ Day Delivery</a></p>', 'Y', 'N'),
(3, '3+ Day Delivery', '3+ Day Delivery', '<p>2 Days&nbsp;</p>', 'Y', 'N'),
(4, 'Same Day Delivery', '', 'same day', 'Y', 'N');


INSERT INTO `set_delivery_package_details` (`pac_id`, `unique_id`, `title`, `career_id`, `service_id`, `start_weight_range`, `end_weight_range`, `set_price`, `sel_countrys`, `dimesion_height`, `dimesion_width`, `dimesion_girth`, `dimesion_weight`, `service_type`, `delivery_within`, `collactions_made`, `fully_trackble`, `prienter_required`, `compensation`, `description`, `career_service_image_path`, `9am_delivery_charge`, `10am_delivery_charge`, `11am_delivery_charge`, `12am_delivery_charge`, `entry_date`, `from_time`, `to_time`, `status`, `deleted`) VALUES
(1, 'AAADLL', 'testing', 11, 1, '0', '1', '5', '94,222', '10', '10', '10', '300', 'L_D_O', '', '', 'Y', 'Y', '', '', '', '', '', '', '', '2015-06-20', '', '', 'Y', 'N'),
(2, 'AAADLL', 'testing', 11, 1, '2', '20', '10', '94,222', '10', '10', '10', '300', 'L_D_O', '', '', 'Y', 'Y', '', '', '', '', '', '', '', '2015-06-20', '', '', 'Y', 'N'),
(3, 'AAADLL', 'testing', 11, 1, '21', '50', '20', '94,222', '10', '10', '10', '300', 'L_D_O', '', '', 'Y', 'Y', '', '', '', '', '', '', '', '2015-06-20', '', '', 'Y', 'N'),
(4, 'AAADLL', 'testing', 11, 1, '51', '300', '30', '94,222', '10', '10', '10', '300', 'L_D_O', '', '', 'Y', 'Y', '', '', '', '', '', '', '', '2015-06-20', '', '', 'Y', 'N'),
(5, 'AAADLL', 'testing', 11, 1, '300', 'FLAT', '50', '94,222', '10', '10', '10', '300', 'L_D_O', '', '', 'Y', 'Y', '', '', '', '', '', '', '', '2015-06-20', '', '', 'Y', 'N'),
(6, 'IAVHUW', '23-6-2015', 11, 1, '0', '1', '5', '94,222', '20', '20', '20', '50', 'L_D_O', '2 days', '', 'Y', 'Y', 'this is info for compensation', '<p>Test description there.</p>', '', '10', '5', '5', '5', '2015-06-23', '01:00', '13:59', 'Y', 'N'),
(7, 'IAVHUW', '23-6-2015', 11, 1, '2', '20', '10', '94,222', '20', '20', '20', '50', 'L_D_O', '2 days', '', 'Y', 'Y', 'this is info for compensation', '<p>Test description there.</p>', '', '10', '5', '5', '5', '2015-06-23', '01:00', '13:59', 'Y', 'N'),
(8, 'IAVHUW', '23-6-2015', 11, 1, '21', '50', '10', '94,222', '20', '20', '20', '50', 'L_D_O', '2 days', '', 'Y', 'Y', 'this is info for compensation', '<p>Test description there.</p>', '', '10', '5', '5', '5', '2015-06-23', '01:00', '13:59', 'Y', 'N'),
(9, 'IAVHUW', '23-6-2015', 11, 1, '51', '300', '20', '94,222', '20', '20', '20', '50', 'L_D_O', '2 days', '', 'Y', 'Y', 'this is info for compensation', '<p>Test description there.</p>', '', '10', '5', '5', '5', '2015-06-23', '01:00', '13:59', 'Y', 'N'),
(10, 'IAVHUW', '23-6-2015', 11, 1, '300', 'FLAT', '25', '94,222', '20', '20', '20', '50', 'L_D_O', '2 days', '', 'Y', 'Y', 'this is info for compensation', '<p>Test description there.</p>', '', '10', '5', '5', '5', '2015-06-23', '01:00', '13:59', 'Y', 'N'),
(11, 'AFQCXL', '23 June 2015', 11, 1, '0', '1', '2', '94,222', '10', '10', '10', '15', 'L_D_O', '2', '', 'Y', 'Y', 'Info for comper', '<p>the desctripton</p>', '', '2', '5', '5', '10', '2015-06-23', '14:05', '17:02', 'Y', 'N'),
(12, 'AFQCXL', '23 June 2015', 11, 1, '2', '20', '4', '94,222', '10', '10', '10', '15', 'L_D_O', '2', '', 'Y', 'Y', 'Info for comper', '<p>the desctripton</p>', '', '2', '5', '5', '10', '2015-06-23', '14:05', '17:02', 'Y', 'N'),
(13, 'AFQCXL', '23 June 2015', 11, 1, '21', '50', '8', '94,222', '10', '10', '10', '15', 'L_D_O', '2', '', 'Y', 'Y', 'Info for comper', '<p>the desctripton</p>', '', '2', '5', '5', '10', '2015-06-23', '14:05', '17:02', 'Y', 'N'),
(14, 'AFQCXL', '23 June 2015', 11, 1, '51', '300', '10', '94,222', '10', '10', '10', '15', 'L_D_O', '2', '', 'Y', 'Y', 'Info for comper', '<p>the desctripton</p>', '', '2', '5', '5', '10', '2015-06-23', '14:05', '17:02', 'Y', 'N'),
(15, 'AFQCXL', '23 June 2015', 11, 1, '300', 'FLAT', '12', '94,222', '10', '10', '10', '15', 'L_D_O', '2', '', 'Y', 'Y', 'Info for comper', '<p>the desctripton</p>', '', '2', '5', '5', '10', '2015-06-23', '14:05', '17:02', 'Y', 'N');